Delete rows in cell arrays
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
Have have got the following cell array:
![cellarray.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/220427/cellarray.png)
How can I delete the first row of the cell and add to each element in the first row 'Equity'. The end result should be for the first element: '1 HK Equity'
Thank you in advance for your help.
4 commentaires
Stephen23
le 21 Mai 2019
Modifié(e) : Stephen23
le 21 Mai 2019
"How to save a local variable (which exists during the running of a function)?"
Set a breakpoint in the function on a line that executes after that variable is defined. Once the code pauses, save the variable in a .mat file. Then continue/stop the code execution.
Réponse acceptée
KSSV
le 21 Mai 2019
load CellBdS.mat ;
s = rawPortData{1}.INDX_MWEIGHT_HIST ;
s = s{1} ;
c1 = s(:,1) ;
% delete first row
c1(1) = [] ;
% add Equity
c1 = strcat(c1,' Equity') ;
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import and Export dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!