Matlab character matrices

  • MATLAB
  • Thread starter DmytriE
  • Start date
  • #1
78
0

Main Question or Discussion Point

Hi everyone,

I am wondering if I can input a matrix into Matlab that contains characters. I then would like to manipulate the matrix using row changing operations. Matlab, however, will not allow me to create a matrix with letters. Is there an equivalent to a matrix for character values that can have operations performed on them?

Thanks.
 

Answers and Replies

  • #3
78
0
Maybe I'm using cells incorrectly, but to test I am multiplying a 4x4 matrix / array with the 4x4 identity. It should return the original matrix / array. However, I get an error message that won't allow me to perform the operation.

"??? Undefined function or method 'mtimes' for input arguments of type 'cell'.

This is irritating. :mad: I wanted to use this as a check for my homework but I can't. Is there anyway around this error?

Thanks!
 
  • #4
jhae2.718
Gold Member
1,161
20
Are you just trying to do symbolic math with matrices? You can use sym or the shortcut syms to create symbolic variables and then create a matrix using them. E.g. for something like
[tex]
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix} = ad - bc
[/tex]
you could do:
Code:
syms a b c d [color=#008000]real[/color];
det([a b; c d]);
I didn't realize you needed to do matrix arithmetic, so cells won't work.
 

Related Threads on Matlab character matrices

  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
5
Views
4K
Replies
1
Views
9K
Replies
1
Views
4K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
2
Views
2K
Replies
28
Views
54K
Replies
2
Views
2K
Replies
3
Views
1K
Replies
1
Views
3K
Top