Delete rows in cell arrays

2 views (last 30 days)
BdS
BdS on 21 May 2019
Answered: KSSV on 21 May 2019
Hi,
Have have got the following cell array:
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 Comments
Stephen23
Stephen23 on 21 May 2019
Edited: Stephen23 on 21 May 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.
BdS
BdS on 21 May 2019
Thank you. My .mat file is enclosed

Sign in to comment.

Accepted Answer

KSSV
KSSV on 21 May 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') ;

More Answers (0)

Categories

Find more on Data Import and Export in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!