Error using evalin Undefined function or variable ‘x’. Error in sym/eval (line 11) s = evalin(‘caller’,vectorize(map2mat(char(x))));
i was trying to solve a simple system of equations, when the program gives me this error:
Error using evalin
Undefined function or variable ‘x’.
Error in sym/eval (line 11)
s = evalin(‘caller’,vectorize(map2mat(char(x))));
Error in es_6_analisi_cinematica (line 27)
xBposizioni=eval(solB.xBsol);
in fact when I go to evaluate the solutions of the system inside solB, it solves the system in x and y, rather than xBsol and yBsol. sorry that the script may seem strange but I’m Italian
i get the same problem using vpa instead of eval, the system of equations is solved with other variables, x and y
This is the script:
clear
AC=0.15;
BC=0.2;
AD=0.35;
xA=0;
yA=0;
rA=[xA yA 0];
xC=AC;
yC=0;
rC=[xC yC 0];
ii=0;
for phi=10^(-17):pi/36:2*pi
xD=AD*cos(phi);
yD=AD*sin(phi);
rD=[xD yD 0];
xBsol=sym(‘xBsol’);
yBsol=sym(‘yBsol’);
eqB1=‘xBsol*sin(phi)-yBsol*cos(phi)=0’;
eqB2=‘(xC-xBsol)^2+yBsol^2-BC^2=0’;
solB=solve(eqB1,eqB2,‘xBsol’,‘yBsol’);
xBposizioni=eval(solB.xBsol);
yBposizioni=eval(solB.yBsol);
xB1=xBposizioni(1)
yB1=yBposizioni(1)
xB2=xBposizioni(2)
yB2=yBposizioni(2)
if (phi>=0 && phi<=pi)
if yB1>=0 xB=xB1;yB=yB1;
else
xB=xB2;yB=yB2;
end
end
if (phi>pi && phi< 2*pi)
if yB1<0
xB=xB1; yB=yB1;
else
xB=xB2; yB=yB2;
end
end
rB=[xB yB 0];
figure(1)
plot([xA,xB],[yA,yB],‘k-‘,[xB, xC],[yB,yC],‘r-‘,[xA,xC],[yA,yC],‘b-‘,[xB,xD],[yB,yD],‘g-‘)
text(xA,yA,‘A’)
text(xB,yB,‘B’)
text(xC,yC,‘C’)
text(xD,yD,‘D’)
hold on
xlim([-0.5 0.5])
ylim([-0.5 0.5])
end
Accepted Answer
Edited: Stephan
on 23 Nov 2020
clear
AC=0.15;
BC=0.2;
AD=0.35;
xA=0;
yA=0;
rA=[xA yA 0];
xC=AC;
yC=0;
rC=[xC yC 0];
syms xBsol yBsol
ii=0;
for phi=10^(-17):pi/36:2*pi
xD=AD*cos(phi);
yD=AD*sin(phi);
rD=[xD yD 0];
eqB1=xBsol*sin(phi)-yBsol*cos(phi)==0;
eqB2=(xC-xBsol)^2+yBsol^2-BC^2==0;
solB=solve(eqB1,eqB2,xBsol,yBsol);
xBposizioni=eval(solB.xBsol);
yBposizioni=eval(solB.yBsol);
xB1=xBposizioni(1);
yB1=yBposizioni(1);
xB2=xBposizioni(2);
yB2=yBposizioni(2);
if (phi>=0 && phi<=pi)
if yB1>=0
xB=xB1;
yB=yB1;
else
xB=xB2;yB=yB2;
end
end
if (phi>pi && phi< 2*pi)
if yB1<0
xB=xB1; yB=yB1;
else
xB=xB2; yB=yB2;
end
end
rB=[xB yB 0];
figure(1)
plot([xA,xB],[yA,yB],‘k-‘,[xB, xC],[yB,yC],‘r-‘,[xA,xC],[yA,yC],‘b-‘,[xB,xD],[yB,yD],‘g-‘)
text(xA,yA,‘A’)
text(xB,yB,‘B’)
text(xC,yC,‘C’)
text(xD,yD,‘D’)
hold on
xlim([-0.5 0.5])
ylim([-0.5 0.5])
end
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Error using evalin Undefined function or variable ‘x’. Error in sym/eval (line 11) s = evalin(‘caller’,vectorize(map2mat(char(x))));
Direct link to this question
Direct link to this question
1 Comment
Direct link to this comment
Direct link to this comment
Accepted Answer
Direct link to this answer
Direct link to this answer
0 Comments
More Answers (0)
See Also
Categories
Products
Release
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 简体中文 Chinese
- English
- 日本 Japanese (日本語)
- 한국 Korean (한국어)
Accelerating the pace of engineering and science
MathWorks is the leading developer of mathematical computing software for engineers and scientists.
Источник
Using eval undefined function or variable
Direct link to this question
Direct link to this question
0 Comments
Accepted Answer
Direct link to this answer
Direct link to this answer
0 Comments
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 简体中文 Chinese
- English
- 日本 Japanese (日本語)
- 한국 Korean (한국어)
Accelerating the pace of engineering and science
MathWorks is the leading developer of mathematical computing software for engineers and scientists.
Источник
Unrecognized function or variable
Direct link to this question
Direct link to this question
0 Comments
Answers (1)
Direct link to this answer
Direct link to this answer
2 Comments
Direct link to this comment
Direct link to this comment
Direct link to this comment
Direct link to this comment
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 简体中文 Chinese
- English
- 日本 Japanese (日本語)
- 한국 Korean (한국어)
Accelerating the pace of engineering and science
MathWorks is the leading developer of mathematical computing software for engineers and scientists.
Источник
Unrecognized function or variable
Direct link to this question
Direct link to this question
0 Comments
Answers (1)
Direct link to this answer
Direct link to this answer
2 Comments
Direct link to this comment
Direct link to this comment
Direct link to this comment
Direct link to this comment
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 简体中文 Chinese
- English
- 日本 Japanese (日本語)
- 한국 Korean (한국어)
Accelerating the pace of engineering and science
MathWorks is the leading developer of mathematical computing software for engineers and scientists.
Источник
Unrecognized function or variable ‘x’.
Direct link to this question
Direct link to this question
0 Comments
Answers (1)
Direct link to this answer
Direct link to this answer
0 Comments
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 简体中文 Chinese
- English
- 日本 Japanese (日本語)
- 한국 Korean (한국어)
Accelerating the pace of engineering and science
MathWorks is the leading developer of mathematical computing software for engineers and scientists.
Источник
0 / 0 / 0
Регистрация: 27.11.2016
Сообщений: 3
1
Найти экстремаль функционала
27.11.2016, 23:31. Показов 3177. Ответов 1
Прошу помощи. Необходимо найти экстремаль функционала.
В моем решении появляется три неизвестных при решении уравнения Эйлера?
Ошибка в моем понимании функции или же нужно решить систему из двух уравнений с тремя неизвестными, чтобы все работало?
Matlab M | ||
|
Matlab M | ||
|
Скажите как удалить тему с форума?
Миниатюры
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь
0