RR=5;
RS=750:150:3600;
for i=1:length(RS)
k(i)=RR.*RS(i)
end
am i not supposed to get the answer k(i) in the form of matrix ?
Here RS is matrix of size 1*20.
if i want to get k(i) in terms of 1*20 , what shall i do ? Please tell me. Thankyou.

 채택된 답변

Alan Stevens
Alan Stevens 2020년 7월 22일

0 개 추천

k is 1x20
>> RR=5;
RS=750:150:3600;
for i=1:length(RS)
k(i)=RR.*RS(i);
end
>> k
k =
Columns 1 through 11
3750 4500 5250 6000 6750 7500 8250 9000 9750 10500 11250
Columns 12 through 20
12000 12750 13500 14250 15000 15750 16500 17250 18000

댓글 수: 3

Asif Rashid
Asif Rashid 2020년 7월 22일
Thankyou for correcting me. its working with k .
can you please tell me that why k(i) is a scalar and k be a matrix ? im confused. Thankyou
Alan Stevens
Alan Stevens 2020년 7월 22일
k(i) simply identifies the i'th value of vector k. i.e. it is a single element of k.
Asif Rashid
Asif Rashid 2020년 7월 22일
Alright Sir, Thankyou

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

추가 답변 (1개)

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

질문:

2020년 7월 22일

답변:

2020년 7월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by