Symbolic equation messed up LIVE script

Dear all I have the code
clear
syms R G1 G2 Gn
G = 1 / R
The output of last is
G= symans,32,0,321
Shouldnt it be 1/R ... I tried clear and i get the same garbled answer I wonder where i made the mistake , must be something really stupid LOL

댓글 수: 5

timo
timo 2016년 3월 16일
편집: timo 2016년 3월 16일
This works
clear
syms R
G = 1 / R
This also works
clear
syms R G1 Gn
G = 1 / R
G2 is the culprit ... HOW
WTF
Javier Bastante
Javier Bastante 2016년 3월 16일
편집: Javier Bastante 2016년 3월 16일
It works great to me man...
timo
timo 2016년 3월 16일
I added the file Please click run all and look at line 40
Unlike your question, your file contains an additional clear all in the same section. Put a section break before that, and the output is as expected. (I created a defect report for this, to improve the behavior in future versions.)
Or maybe even better, reconsider using clear all altogether; in most cases, a simple clear is completely sufficient, if even that is needed.
timo
timo 2016년 3월 17일
The clear all was added by the converter automatically. I think it tries to clear "all" variable Anyway I rewrote the doc and now it works

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

답변 (0개)

태그

질문:

2016년 3월 16일

댓글:

2016년 3월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by