- #1

cookiemnstr510510

- 162

- 14

- TL;DR Summary
- I am currently taking MATLAB. We are using the textbook: MATLAB for Engineers fourth edition by Holly Moore. I am in the symbolic mathematics section and am having some issues. I am using MATLAB R2018b

Hello All!

I am finding some inconsistencies with my textbook and MATLAB. I am in the section of symbolic mathematics.

I follow the textbook word for word and I am getting some errors. When I am trying to create an entire equation and give it a name like:

ideal_gas_law=sym('P*V=n*R*Temp') I get the error:

Error using sym>convertChar (line 1459)

Character vectors and strings in the first argument can only specify a variable or number.

To evaluate character vectors and strings representing symbolic expressions, use 'str2sym'.

Error in sym>tomupad (line 1225)

S = convertChar(x);

Error in sym (line 214)

S.s = tomupad(x);

Just by looking at this error I have no idea what it is trying to tell me, I tried this:

ideal_gas_law=str2sym(sym('P*V=n*R*Temp))

with no luck.

I looked online and saw some info about it, but reading that didn't clear anything up for me. I am wondering if someone could show me how to write an equation like the one above. What do I need to do? What am I not doing correctly? Any help is much appreciated. Programming is pretty difficult for me (and I know MATLAB is not considered programming), so if you could sort of spell things out for me as much as possible that would be best for my learning style.

Thank you

Happy Weekend!

I am finding some inconsistencies with my textbook and MATLAB. I am in the section of symbolic mathematics.

I follow the textbook word for word and I am getting some errors. When I am trying to create an entire equation and give it a name like:

ideal_gas_law=sym('P*V=n*R*Temp') I get the error:

Error using sym>convertChar (line 1459)

Character vectors and strings in the first argument can only specify a variable or number.

To evaluate character vectors and strings representing symbolic expressions, use 'str2sym'.

Error in sym>tomupad (line 1225)

S = convertChar(x);

Error in sym (line 214)

S.s = tomupad(x);

Just by looking at this error I have no idea what it is trying to tell me, I tried this:

ideal_gas_law=str2sym(sym('P*V=n*R*Temp))

with no luck.

I looked online and saw some info about it, but reading that didn't clear anything up for me. I am wondering if someone could show me how to write an equation like the one above. What do I need to do? What am I not doing correctly? Any help is much appreciated. Programming is pretty difficult for me (and I know MATLAB is not considered programming), so if you could sort of spell things out for me as much as possible that would be best for my learning style.

Thank you

Happy Weekend!

Last edited by a moderator: