Rank: Newbie
Groups: Registered
Joined: 28/05/2019(UTC) Posts: 3
|
I'm having issues with using variables, I have a bunch of equations that have a single variable (end goal is to plot this) and when I use variable functions/matrices they make the outputs wrong somehow. I have no issues when setting x to be a single number, but when I set x to a range of numbers the outputs go wrong. https://imgur.com/a/B4Y8Sodhttps://imgur.com/a/Qk3IxY8Am I just doing it wrong? Edited by user 28 May 2019 03:02:20(UTC)
| Reason: Fixing screen shots
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: krugerdude I'm having issues with using variables, I have a bunch of equations that have a single variable (end goal is to plot this) and when I use variable functions/matrices they make the outputs wrong somehow. I have no issues when setting x to be a single number, but when I set x to a range of numbers the outputs go wrong.
Please: attach the Smath work sheet to see what you may be missing.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 28/05/2019(UTC) Posts: 3
|
Smath Data Ranges.sm (695kb) downloaded 21 time(s).Here is the smath file, the important parts are at the bottom.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/12/2011(UTC) Posts: 319 Location: italy Was thanked: 109 time(s) in 93 post(s)
|
you have to use the vectorize function sergio
|
1 user thanked PompelmoTell for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: krugerdude Here is the smath file, the important parts are at the bottom. ...added at the end of your document. Smath Data Ranges.sm (701kb) downloaded 7 time(s).
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 28/05/2019(UTC) Posts: 3
|
Thanks for your help, the vectors did the trick (although I don't understand why they have to be vectors). Here is the end result,
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/12/2011(UTC) Posts: 319 Location: italy Was thanked: 109 time(s) in 93 post(s)
|
Obviously it's not a trick. That way you ask to perform the evaluation element by element contained in the vector. In the wrong way you used, perform the evaluation in a matrix sense (following the rules on matrix operations) because x1 is a matrix (vector).
sergio
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Another form. The arrow is a vector summation. |
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.