How to delete contents of matrix only if it has 2 elements?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Asher Zaidi
am 11 Jun. 2018
Kommentiert: Asher Zaidi
am 11 Jun. 2018
If p = [55;56], and I want to set it to one value (ex. p = 55), how can I write an "if" statement that does this using elements? As of now, I can only do it with this specific condition, but I would like to write "if p has more than one element, then set p equal to the first element." Code:
if p == [55;56]
p(2) =[]
end
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!