Problem with defining size of a matrix

1 view (last 30 days)
Screen Shot 2019-02-18 at 2.59.41 PM.png
I am trying to define the size of the matrix A, but it reports an error. I searched on Google for this algorithm, and I'm following the exact same procedure. I dont't know what happened.
Thanks in advance for your help!

Accepted Answer

Adam Danz
Adam Danz on 18 Feb 2019
Edited: Adam Danz on 18 Feb 2019
The error is coming from a function (or m-file) named "Q2". Perhaps the "myCGS()" function is stored in an m-file named "Q2"? Your function name should match your mfile name. Also, the name "Q2" is a really bad function name.
In any case, you are probably not passing an input argument to the function. If you run that function without an input argument, you'll get exactly that error.
  2 Comments
Xiaodie Ni
Xiaodie Ni on 19 Feb 2019
Thanks Adam! I fix the function name. But I still don't understand how to pass an input argument to the function? Do I do that in the command? Or do I add a line in the function section before the "end"?
I was trying to add the below two lines.
A=[1,-2,1;0,1,3;1,1,0;0,1,-1]
[Q,R]=myCGA(A)
Adam Danz
Adam Danz on 19 Feb 2019
You can call the function from the command window or from within another function or script. The input you suggested above should satisfy the error.
To test the function, it might be easiest running the code with the 'A' matrix from the command window.

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!