logo elektroda
logo elektroda
X
logo elektroda

How to Plot 3D Surface in Matlab Using meshgrid, logspace, and surf Functions?

36 7
ADVERTISEMENT
  • #1 21665650
    Danish Mehmood
    Anonymous  
  • ADVERTISEMENT
  • #2 21665651
    franticEE carlitos
    Anonymous  
  • ADVERTISEMENT
  • #3 21665652
    Benedito Ubirata Silva
    Anonymous  
  • ADVERTISEMENT
  • #4 21665653
    Earl Albin
    Anonymous  
  • ADVERTISEMENT
  • #5 21665654
    Danish Mehmood
    Anonymous  
  • #6 21665655
    Danish Mehmood
    Anonymous  
  • #7 21665656
    Benedito Ubirata Silva
    Anonymous  
  • #8 21665657
    Benedito Ubirata Silva
    Anonymous  

Topic summary

The discussion addresses issues encountered when plotting a 3D surface in MATLAB using meshgrid, logspace, and surf functions. The original code defines vectors x and y with linspace and logspace, creates mesh grids, computes z as a function of x and y, and attempts to plot using surf(z) with logarithmic scaling on the y-axis. Problems arise due to syntax errors such as missing commas in the meshgrid command ([x, y] instead of [x y]) and incorrect element-wise power operators (e.g., x.^2 and y.^0.6). The importance of correct MATLAB syntax, including proper use of commas in array definitions and element-wise operations, is emphasized. The user references a related graph from a research file on interference analysis in cognitive femtocells but faces difficulties sharing the file and resolving errors. The solution involves correcting syntax errors and ensuring proper function calls to generate the desired 3D surface plot with logarithmic scaling on the y-axis and appropriate axis labels.
Summary generated by the language model.
ADVERTISEMENT