Clear Filters
Clear Filters

Make a larger matrix from smaller ones

1 view (last 30 days)
Ahmad El-Kassem
Ahmad El-Kassem on 10 Mar 2017
Commented: David Goodmanson on 11 Mar 2017
what I am trying to do in matlab is making a matrix from 2 smaller ones in a specific order
consider we have 2 matrices 2*2 called A and B. where k1 and k2 are constants
k1 = 50 k2 = 100
A = [k1 -k1; -k1 k1] B = [k2 -k2; -k2 k2]
now i want it to look like this in a larger matrix
C = [k1 -k1 0; -k1 k1+k2 -k2;0 -k2 k2]
is this possiple to do in matlab? this is just an simple example but i genarelly works with much larger matrixes with the same order.
thanks in advance :-)
  6 Comments
Ahmad El-Kassem
Ahmad El-Kassem on 10 Mar 2017
Edited: Ahmad El-Kassem on 10 Mar 2017
Yes i am trying to do an addition of translated matrices but just on a larger scale. I saw my teacher make a loop to solve this
ps. i Forgot that the Forum.m is a special case that is not interested in this topic. Sorry :-)
David Goodmanson
David Goodmanson on 11 Mar 2017
Hi Ahmad, If you are saying that this website is not interested in this kind of problem, then that is not true. The initial comments above were about understanding the nature of the problem, not with the problem itself. People get assistance on indexing problems similar to this all the time. The only consideration is that the person asking the question has defined the issue, made an effort to solve it, and usually has supplied some code that does not work yet.

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!