필터 지우기
필터 지우기

How can I add a zero element to a cell array?

조회 수: 1 (최근 30일)
Parham Babakhani Dehkordi
Parham Babakhani Dehkordi 2016년 5월 16일
편집: the cyclist 2016년 5월 17일
Hi everyone, I have two cell arrays as:
B=[1*44997] and time=t=[1*44998]. The values in B are zero, 1 and -1. I would like to assign a zero value to the last element of B so that I would be able to plot B as a function of (t) because there are not the same length. How can I make two cell array the same dimension?
  댓글 수: 1
Jan
Jan 2016년 5월 16일
Are you sure, that you mean "cell array"? Please read doc cell.

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

채택된 답변

the cyclist
the cyclist 2016년 5월 16일
  댓글 수: 3
Guillaume
Guillaume 2016년 5월 17일
If it worked, then your question was very misleading as you do not have cell arrays, but plain matrices. As per Jan's comment, please read the documentation on cell arrays.
the cyclist
the cyclist 2016년 5월 17일
편집: the cyclist 2016년 5월 17일
Not necessarily true, Guillaume. That syntax will also work with cell arrays. For example, this is a valid MATLAB statement
C = [{'a',1,'b'},0]

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

추가 답변 (0개)

카테고리

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