Need help in plotting contour of speed, torque and eff
Show older comments
I am struggling in plotting a contour of eff, speed and torque. Please see the attached workspace.mat attached to this file.
Answers (1)
KSSV
on 16 Sep 2021
scatter(eff,speed,[],torque,'filled')

You cannot plot contour with the given data. You have 1D data. You need to have 2D data i.e. matrices to plot contours.
10 Comments
satendra kumar
on 16 Sep 2021
Edited: satendra kumar
on 16 Sep 2021
satendra kumar
on 16 Sep 2021
KSSV
on 16 Sep 2021
Check the values of both the plots...... you need to think on your data.
satendra kumar
on 16 Sep 2021
KSSV
on 16 Sep 2021
Try like this:
x = eff ; y = speed ; z = torque ;
xi = unique(x) ; yi = unique(y) ;
[X,Y] = meshgrid(xi,yi) ;
Z = reshape(z,size(X)) ;
figure
surf(X,Y,Z)
satendra kumar
on 16 Sep 2021
KSSV
on 16 Sep 2021
Attach the data for which you got this error. You should not use:
Z=meshgrid(Z);
satendra kumar
on 16 Sep 2021
Edited: satendra kumar
on 16 Sep 2021
KSSV
on 16 Sep 2021
Offcourse with that data you will get error. The given data is corresponds to curve.
satendra kumar
on 16 Sep 2021
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


