for i=1:size(strain,1)
if i ~=1 && i~=size(strain,1)
rss=strain(i,:)
ff=repelem(rss,[2],[1])
end
end
s=[firstrow; ff ;lastrow]
i rss to save each time the row that im extracting, however it is not saving, i tried to use rss(i) and it is saying that (Unable to perform assignment because the indices on the left side are not compatible with the size of the right side). i tried to use {I} instead and the first row is coming out to be empty.
what is the solution?
i want rss to save everytime is is extracting the specified row

댓글 수: 3

Sailesh Kalyanapu
Sailesh Kalyanapu 2022년 5월 19일
Hey! Could you elaborate on your query through an example?
KSSV
KSSV 2022년 5월 19일
The codes looks illogic. You need not to use a loop to repeat the elements. What exactly you are trying to do?
Jan
Jan 2022년 5월 19일
@Mahmoud Chawki: The purpose of the code is not clear. Then it is not possible to fix it.
Replace
for i=1:size(strain,1)
if i ~=1 && i~=size(strain,1)
by
for i = 2:size(strain,1) - 1
But what should be the contents of ff?

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2022년 5월 15일

댓글:

Jan
2022년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by