Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

how can i split a column and create a new one??

1 Ansicht (letzte 30 Tage)
wasima tammi
wasima tammi am 1 Mär. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
suppose A is the column A= 1 2 3 4 4 4 4 3 3 3 2 2 1 and i want m= 1 1; n= 2 2 2; o= 3 3 3 3; p= 4 4 4 4 ;
can anyone tell me this???

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 1 Mär. 2015
A=[ 1 2 3 4 4 4 4 3 3 3 2 2 1]
[B,ii,jj]=unique(A)
out=accumarray(jj,1:numel(jj),[],@(x) {A(x)})
celldisp(out)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by