필터 지우기
필터 지우기

series with empty entrys

조회 수: 2 (최근 30일)
Linden
Linden 2014년 5월 21일
편집: Jos (10584) 2014년 5월 21일
Hi I have a series (double) with the demension of 61x1. I want to enlarge it to 63x1 with the last two values to be empty. How can I do this? Many thanks

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 5월 21일
a={1;2;3}
a(end+1:end+2)={[]}
  댓글 수: 1
Linden
Linden 2014년 5월 21일
Thanks Azzi. But this would not go with my series because the series is in double.

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


Jos (10584)
Jos (10584) 2014년 5월 21일
편집: Jos (10584) 2014년 5월 21일
Each element in a double array has to be set to something. It cannot be empty.
You can use NaN (or maybe also zero) as a place-holder to make the array having a particular size
A = 1:3
B = 10:10:50
% Now, I want A to have two extra elements, because B has
% 5 elements, and I want to add each element of A to the
% corresponding element of B
A(4:5) = NaN
C = A + B
  댓글 수: 1
Linden
Linden 2014년 5월 21일
cool thanks a lot

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by