Generate an array within three loops

조회 수: 1 (최근 30일)
melad atunse
melad atunse 2020년 1월 16일
댓글: David Hill 2020년 1월 16일
82158807_848872355563229_1562809247484346368_n.png
  댓글 수: 1
melad atunse
melad atunse 2020년 1월 16일
Enter values c1 into an array

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

답변 (1개)

David Hill
David Hill 2020년 1월 16일
count=1;
for n=.1:.1:.5
for m=.1:.1:.5
for k=1:5
c(count)=94*2.4^n*.4^m;%1^k is always 1, so it doesn't matter
count=count+1
end
end
end
  댓글 수: 2
melad atunse
melad atunse 2020년 1월 16일
First, thank you very much for your interest
Secondly I have other data in which the values of A (1,4) are more and less than 1, for example 0.5 or 1.5 then what will I do
David Hill
David Hill 2020년 1월 16일
count=1;
a=[94 2.4 .4 1];
for n=.1:.1:.5
for m=.1:.1:.5
for k=.1:.1:5
c(count)=A(1,1)*A(1,2)^n*A(1,3)^m*A(1,4)^k;
count=count+1
end
end
end

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

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by