Skip to main content
1-Visitor
August 30, 2017
Solved

This value must be scalar or matrix error when trying to plot curves

  • August 30, 2017
  • 2 replies
  • 5323 views

Hello everyone,

I am having issues with using the range function in mathcad to plot two functions I have written. The range variable I have created is presenting an error when I include it in one of my functions in order to generate the independent variables that will be used by the other 2 functions. It seems like there should be a fairly simple solution to this issue but this is my first time using mathcad so I don't seem to have the knowledge to solve it. I have attached my file where it is possible to see the issue that I have. THank you for your time, and I hope that you can help.

Best answer by MJG

Attached

2 replies

1-Visitor
August 30, 2017

Maybe so, if I understood you correctly

1-Visitor
August 30, 2017

your variable fi utilizes the literal subscript (f.i), but should use the index subscript (f[i)

Then, your graphs should be plotted M(f) over f instead of M(f.i) over f.i.

 

However, after making these two changes, an error still exists with M(f).  I didn't follow the math to understand what.

 

 

Edit:

Think I found the cause of the error:

M(f):=20*log(|T(f)|)

In this equation, Mathcad is taking the determinate of T(f) instead of taking the absolute value of each element of T(f).

One solution is to use the vectorize modifier (Ctrl-) over |T(f)|.

1-Visitor
August 30, 2017

Thanks for the suggestions. I don't really know how to implement them, however.  Could you post the file with these changes made so I can see if they give me the expected result?

MJG1-VisitorAnswer
1-Visitor
August 30, 2017