Feeds
提问
I wanna implement this function, but it says there is an syntax error..
function y=myfunc(x) y=(x<0).*(2*exp(x)+(0<=x&x<1).*2+(1<=x&x<3).*(x^2-4*x+5)+(3<=x).*(1+cos(x-3)); endfunction
3 years 前 | 1 个回答 | 0
1
个回答提问
I want to draw a mesh surface. But when I use that code to draw it, YZ line is disappeared...
x=[1 2 3]; y=[1 2 3 4]; [X,Y]=meshgrid(x,y); Z=Y; plot3(X,Y,Z)
3 years 前 | 1 个回答 | 0
