How to plot this complicated function 2-D

조회 수: 5 (최근 30일)
Rouben Khosrovian
Rouben Khosrovian 2019년 3월 28일
답변: Rouben Khosrovian 2019년 4월 4일
Hello everyone.
Im trying yo plot a function which has only 1 variable but it is a complicated function. i know hot to plot y=sin(x) or y=x but for some reason i failed this time . please help.
cp(x) is funtion i want to plot.
x=((23.5*pi*50)/(52.7*V));
y=1/((1/x)-0.035);
cp(x)=0.9*(0.5176*((116/y)-5)*exp(21/y)+(0.0068*x))
but there is 1 more problem.
when i calculate cp(x) in the way described bellow, and plot it in geogebra (I know its not professional ) and also plot cp(x) original funtion by replacing x and y in cp, I get 2 different resaults which are really different. They have same shape though.
syms x;
y=1/((1/x)-0.035);
cp(x)=0.9*(0.5176*((116/y)-5)*exp(21/y)+(0.0068*x));
cp(x)
for this reason I dont want to first calculate cp(x) and then plot it. but if there is no other way then let's do it.

채택된 답변

darova
darova 2019년 3월 28일
t = linspace(1,10,50);
plot(t,cp(t))
  댓글 수: 2
Rouben Khosrovian
Rouben Khosrovian 2019년 3월 29일
Hello. my problem is with / command for divide.
t = linspace(1,10,50);
cp(t)=0.9*(0.5176*((116/(1/((1/t)-0.035)))-5)*exp(21/(1/((1/t)-0.035)))+(0.0068*t));
plot(t,cp(t))
Error using /
Matrix dimensions must agree.
on line 1 of error, / is clickable which leads to mrdivide command help page.
Thank you for Help.
Rouben
darova
darova 2019년 3월 29일
try ./ and .*
syms x;
y=1./(1./x-0.035);
cp(x)=0.9*(0.5176*((116./y)-5).*exp(21./y) + 0.0068*x);
t = linspace(1,10,50);
plot(t,cp(t))
read rdivide

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Rouben Khosrovian
Rouben Khosrovian 2019년 4월 4일
Thank you very much for your help. your answer to my question solved all my proble. .

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by