error : minus matrix dimention
4 views (last 30 days)
Hi, I have a m file that has some function, one of them is solveq and it leads to be an error.
I have attached a related mat file.
please help me out, thanks.
Roger Stafford on 5 Nov 2014
Hamid, your 'solveq' function is clearly intended only for an 'f' input argument consisting of a column vector, not the 3-by-n size you mentioned. The function would have to be modified to handle other than a column vector for 'f'.
It looks as if the requirements for the input arguments of 'solveq' are:
1) K should be some n-by-n square matrix
2) f should be an n-by-1 vector
3) bc should have two columns and the first column should consist of some subset of the integers from 1 to n. Consequently there should be fewer than n rows in bc.
Note that if 3) is violated, you will get an error message at the line
If K has fewer columns than rows, you will get an error message at
If f has more than one column, its columns other than the first will be ignored.
By the way, your 'end' in 'solveq' is placed one line too early and would cause 'Q' to be output as all zeros.
Adam on 4 Nov 2014
It's very hard to work out when you don't give any information about the error, but in your attached .mat file 'pdof' has size 6 whereas 'fdof' has size 3 so I imagine the line:
may well be failing due to the domensionality mismatch.
I have no idea what the code is doing, but should the first K(fdof,fdof) maybe be K(fdof,pdof) instead?