how should i store the values of I and X in a vector to plot the graph of I vs X
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Aakash Divakar
am 8 Okt. 2020
Kommentiert: Ameer Hamza
am 8 Okt. 2020
syms f(x)
sym x
f(x)=2*x^2
x=0;
v=[];
diary('wispn.txt')
diary on
while x<0.36
I=int(f,0,x)
x=x+0.1;
v(t)=w(x,I)
t=t+1;
end
diary off
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 8 Okt. 2020
Bearbeitet: Ameer Hamza
am 8 Okt. 2020
A simple approach is
syms f(x)
sym x
f(x) = 2*x^2;
xv = 0; % x is name of sym variable
I = [];
while xv(end) < 0.36
I(end+1) = int(f,x, 0, xv(end));
xv(end+1) = xv(end) + 0.1;
end
xv(end) = [];
plot(xv, I);
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Conversion Between Symbolic and Numeric finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!