How do I do this function?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
x=[-1:0.1:1]
f=x.^2.*sin(pi.*x)
How do I solve this function for g in code?
g=f if f>=0
g=0 if f<0
I tried doing:
if f>=0
g=f
else
g=0
end
It didn't save as a matrix, only as g=0
Please help?
0 Kommentare
Antworten (1)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!