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

2 Ansichten (letzte 30 Tage)
Parham Babakhani Dehkordi
Parham Babakhani Dehkordi am 16 Mai 2016
Bearbeitet: the cyclist am 17 Mai 2016
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 Kommentar
Jan
Jan am 16 Mai 2016
Are you sure, that you mean "cell array"? Please read doc cell.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

the cyclist
the cyclist am 16 Mai 2016
  3 Kommentare
Guillaume
Guillaume am 17 Mai 2016
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 am 17 Mai 2016
Bearbeitet: the cyclist am 17 Mai 2016
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]

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by