Create a Vector based on the Value of another Vector
Mostra commenti meno recenti
Hi,
i have an issue at creating a vector based on the values of another vector. For the sake of abetter understanding, I post here the code which I would like to edit. I have all of my data. I am rettrieving data from an excel file where they are listed along columns and reflect data on different values, based on the value of PERMNO. At one point in the column, the value of PERMNO changes. So I would also like to define different variables Date and Price depending on the value of PERMNO as of the following:
[data, Mname,raw] =xlsread('trial.xlsx','trial','A1:C3309');
save('bubble.mat','raw');
load('bubble.mat');
data = raw;
permno = cell2mat(data(2:end,1));
date = datenum(cell2mat(data(2:end,2)),'dd/mm/yyyy');
price = cell2mat(data(2:end,3));
Any suggestion on how this can be achieved?
3 Commenti
Ankit
il 28 Gen 2022
What is your problem? Are you getting any error ?
Riccardo Della Villa
il 28 Gen 2022
Modificato: Matt J
il 28 Gen 2022
Ankit
il 28 Gen 2022
you can create based on some conditions? But you want to create the price and date vectors based on certain conditions right? Is it possible to tell how your data looks like (size, values etc)?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Time Series Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!