itmr
Member level 3
hhi everybody
i need to code a simple function in matlab and i have some problems
the function getting 4 variable and supose to plot 4 waves.
if the user press just 2 variables thus the function plots 2 waves.
i try to coded its like
function present_sig[x1,x2,x3,x4]
...
if nargin == 2
plot.......
elsif nargin ==4
plot.......
end
and the i try to operste the function from another m. file
the code is ;
persent_sig[x1,x2,x3,x4]
x1=...
x2=...
x3=...
x4=...
and from somehow it doesnt works good
i et error that thevariables undefined.....
i ill be very happy to any assist
thanks all
i need to code a simple function in matlab and i have some problems
the function getting 4 variable and supose to plot 4 waves.
if the user press just 2 variables thus the function plots 2 waves.
i try to coded its like
function present_sig[x1,x2,x3,x4]
...
if nargin == 2
plot.......
elsif nargin ==4
plot.......
end
and the i try to operste the function from another m. file
the code is ;
persent_sig[x1,x2,x3,x4]
x1=...
x2=...
x3=...
x4=...
and from somehow it doesnt works good
i et error that thevariables undefined.....
i ill be very happy to any assist
thanks all