Creating an arbitary symbolic matrix in Matlab

  • Thread starter EbolaPox
  • Start date
  • #1
101
0

Homework Statement


Hi everyone, I'm new to using matlab and had a quick question. I'm trying to write a function such that my input into it is a number, say n, and it produces an n by n matrix with symbolic variables with names of the form aij , where i and j are numbers that refer to its row and column positions. This didn't seem like it would be too terribly tough, but I'm not sure how to make give my matrix these variable names of the form aij. I figured I could write a loop of some form that went from 0 to n and gave each an a1n or something of that form name, just to get at least one row, but I'm not too sure what syntax to use to give the symbolic variable its name. I was hoping I could write a loop with a variable i that ranged from 0 to n, and then do something like syms a'i' or something like that. I thought maybe if I turned the number i into a string, I could do something like that to make a bunch of symbolic variables, but I still had no luck. Any suggestions would be very appreciated. Thanks!
 

Answers and Replies

  • #2
Redbelly98
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
12,102
130
I'm not familiar with Matlab. But wouldn't this involve two nested loops, no matter what programming language is used?
 

Related Threads on Creating an arbitary symbolic matrix in Matlab

  • Last Post
Replies
2
Views
7K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
9
Views
3K
  • Last Post
Replies
6
Views
4K
Replies
6
Views
7K
Replies
0
Views
1K
  • Last Post
Replies
7
Views
20K
  • Last Post
Replies
2
Views
22K
Replies
0
Views
2K
Top