Afficher commentaires plus anciens
Good day,
I'm hawing a issue with 3D, I hawe to make that "Z would be a matrix, not a scalar or vector". Pleas give mea a hint how to acheve it.
x=0:100:50000;
y=x;
inc=(x+y)/2;
br_lim=[9408 14532 57051 270500];
for v1=1:length(inc)
y(v1)=(inc(v1)-br_lim(1,1))/10000;
g(v1)=(inc(v1)-br_lim(1,2))/10000;
if inc(v1)<br_lim(1,1)
Z(v1)=0;
elseif inc(v1)>=br_lim(1,1) && inc(v1)<br_lim(1,2)
Z(v1)=(972.87.*y(v1)+1400).*y(v1);
elseif inc(v1)>=br_lim(1,2) && inc(v1)<br_lim(1,3)
Z(v1)=(212.02.*g(v1)+2397).*g(v1)+972.79;
elseif inc(v1)>=br_lim(1,3) && inc(v1)<br_lim(1,4)
Z(v1)=.42*inc(v1)-8963.74;
else inc(v1)>=br_lim(1,4);
Z(v1)=.45*inc(v1)-17078.74;
end
end
[X,Y]=meshgrid(x,y);
figure
surf(X,Y,Z)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!