필터 지우기
필터 지우기

I have 4X4 stiffness matrix and evey element in matrix is a vecor. How can I write 'for' loop for this matrix so that I will get number of matrices according to variable as element in the matrix?

조회 수: 1 (최근 30일)
I am trying to vary my matrix of size 4X4. The element in the given matrix are the vectors of 10X1. Please help
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 26일
I will get number of matrices according to variable as element in the matrix?
What does that mean. Can you explain that with a short example, let us say a 2x2 cell array
A={[1 2],[3 4];[5 6],[7 8]}
Sandip More
Sandip More 2013년 12월 26일
편집: Azzi Abdelmalek 2013년 12월 26일
Sir, I have
K=
[k1, 0, -k1, -k1/2]
[ 0, k2, -k2, k2/2]
[ -k1, -k2, k1 + k2 + k3 + k4 + k5, k1/2 - k2/2 + (9*k3)/10 - (9*k5)/10]
[ -k1/2, k2/2, k1/2 - k2/2 + (9*k3)/10 - (9*k5)/10, k1/4 + k2/4 + (81*k3)/100 + (81*k5)/100].
In this matrix I want to vary k1, k2, k3, k4 and k5. If I change these values, I should get different K matrix. In short k1, k2, k3, k4 and k5 are the vectors.

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 26일
I don't see where is the problem. For example:
k1=2;
k2=3;
A=[112 2+k1; 2*k1+k2 12]
%If you want to change A, just change the values of k1 and k2,
k1=4;
k2=10;
A
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 26일
Why are you asking? just test your code in Matlab command, and you will see the result.
k1=[1 2 3 4 5];
k2=[1 2 3 4 5];
A=[112 2+k1;2*k1+k2 12]

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by