Error in plotting an equation given y data sets (y vs x)
Show older comments
Hello. I am having trouble plotting a curve y vs x, given y data set from 1 to 30 with an interval of 0.5, through a given equation of
y=52.4*T*((1./x)+(C./(x)^2)); where T and C are constants
The error I am getting is because of the 'sym' that I cannot seem to understand. Please see my code below. Hoping for some help and assistance here. Thank you so much.
syms y x
T=450;
sigma=58.7;
lambda=32.9;
sigma_n=32.3;
lambda_n=7.5;
A=8.314*lambda+sigma/2;
B=32.4*lambda_n+sigma_n/2;
C=sqrt(A*B)/(lambda*lambda_n);
y=[1:0.5:30];
n=(30-1)/0.5;
for i=1:(n+1)
y(i)=52.4*T*((1./x(i))+(C./(x(i))^2));
end
plot(x,y);
1 Comment
KSSV
on 20 Sep 2021
Fist solve the equation for x and then substitue y and then plot.
Accepted Answer
More Answers (0)
Categories
Find more on Conversion Between Symbolic and Numeric 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!

