how i can change the variable? pleasee
Show older comments
Look at the first code, if you realize and = (x. ^ 3) it is the same as E. ^ 3 that I want to do but in a general way in the code of my gui but what happens is that I do not know. The user for example x ^ 2 but I want to read my program to change it to E. ^ 2 and so it can work. My program asks for this to get the area under the curve and graph it
%FIRST CODE
a=input('Since: ');
b=input('until: ');
x=linspace(a,b,500);
y=(x.^3);
syms K;
syms n;
D=(b-a)/n;
E= a+((K-1)*D)+(D/2);
F= (E.^3)*D;
f= symsum (F,K,1,n);
A= limit(f,n,inf)
area(x,y);
grid on;
%SECOND CODE
a=str2double(get(handles.edit7,'string'));
b=str2double(get(handles.edit6,'string'));
x=linspace(a,b,500);
y=(get(handles.edit4,'string'));
j=char(y);
syms K;
syms n;
D=(b-a)/n;
E= a+((K-1)*D)+(D/2);
F=(j)*D;
f= symsum (F,K,1,n);
A= limit(f,n,inf)
axes(handles.axes3);
area(x,y);
grid on;
Accepted Answer
More Answers (0)
Categories
Find more on Code Performance 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!