필터 지우기
필터 지우기

using cell to add row

조회 수: 5 (최근 30일)
aldo
aldo 2023년 11월 10일
답변: Mann Baidi 2023년 11월 10일
xxx={'Lavorato assieme n. giorni',' ',1;'Giorno Positivi e negativi ',' ',2}
xxx = 2×3 cell array
{'Lavorato assieme n. giorni' } {' '} {[1]} {'Giorno Positivi e negativi '} {' '} {[2]}
if i want to add ("Lavorato xxx',' ',3) in this 3x3 cell how can i write code?

채택된 답변

Stephen23
Stephen23 2023년 11월 10일
xxx = {'Lavorato assieme n. giorni',' ',1;'Giorno Positivi e negativi ',' ',2}
xxx = 2×3 cell array
{'Lavorato assieme n. giorni' } {' '} {[1]} {'Giorno Positivi e negativi '} {' '} {[2]}
xxx(3,:) = {'Lavorato xxx',' ',3}
xxx = 3×3 cell array
{'Lavorato assieme n. giorni' } {' '} {[1]} {'Giorno Positivi e negativi '} {' '} {[2]} {'Lavorato xxx' } {' '} {[3]}

추가 답변 (1개)

Mann Baidi
Mann Baidi 2023년 11월 10일
Hi,
I understand you would like to add rows to your cell at the end.
You can do this using the following code:
xxx={'Lavorato assieme n. giorni',' ',1;'Giorno Positivi e negativi ',' ',2}
xxx = 2×3 cell array
{'Lavorato assieme n. giorni' } {' '} {[1]} {'Giorno Positivi e negativi '} {' '} {[2]}
xxx=[xxx;{'Lavorato xxx',' ',3}]
xxx = 3×3 cell array
{'Lavorato assieme n. giorni' } {' '} {[1]} {'Giorno Positivi e negativi '} {' '} {[2]} {'Lavorato xxx' } {' '} {[3]}
Hope this helps!

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by