Data dimensions must agree
16 views (last 30 days)
Show older comments
i have a function z which has two variables x and y. z , x and y are vectors of length 20. While plotting a function, MATLAB says that 'Data dimensions must agree'. Using the commands
x=PitchAngle;
y=TipSpeedRatio;
[xx,yy]=meshgrid(x,y);
zz=PowerCoefficient;
z=reshape(zz,[5,4])
mesh(x,y,z)
I dont know whether i am using the right command. Please lead me to the right way. Thankyou
Accepted Answer
madhan ravi
on 18 Jul 2020
Edited: madhan ravi
on 18 Jul 2020
x = reshape(x, 1, []);
y = reshape(y, 1, []);
[xx, yy]=meshgrid(x,y);
z = repmat(zz(:), 1, size(xx, 2));
mesh(xx, yy, z)
4 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!