Return the value of vectors
Show older comments
How do i need to change the code to get the y returned as a vector?
% global x y
for x=0:0.1:(2*pi)
if x<1
funkcija1();
end
if x>1
funkcija2();
end
end
plot(y,'r:s')
of course i have created my functions in separate files:
%function funkcija1
global x y
y=sin(x)+cos(x);
end
%function funkcija2
global x y
y=sin(x)-cos(x);
end
so when i plot everything i just get a dot and i need a full graph. What could be wrong with the code?
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics 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!