Change the data from table format to double format

Hello everyone
is there any way to change the data from table format to double format in matlab
i want to make the (trainingdata) in double format in one file

Respuestas (3)

Cris LaPierre
Cris LaPierre el 11 de Dic. de 2020
See this link on how to import a spreadsheet into MATLAB.
See this page for instructions on how to access data in a MATLAB table.
SHIVAM KUMAR
SHIVAM KUMAR el 11 de Dic. de 2020
%Just import the table in matlab and it shall come as double .
%Later you can select the required columns using
trainingdata(:,1) %or trainingdata(:,n);
where n is the required column provided the imported varable is training data. or use that name.

8 comentarios

its keeping the data as table
i dont want it as table i want to convert it to double format
Cris LaPierre
Cris LaPierre el 11 de Dic. de 2020
Editada: Cris LaPierre el 11 de Dic. de 2020
A table is just a container. Run this command to see the data type of your variables.
summary(trainingdata)
See this page for instructions on how to access data in a MATLAB table.
Its not as what i want.....but however i found other way
thank you
Kachukwu Okoh
Kachukwu Okoh el 10 de Jun. de 2021
Editada: Kachukwu Okoh el 10 de Jun. de 2021
I am having this same question you asked earlier
Please could you let me know the other way you found on how to change a table format to a double format. Really in need of it urgently.
Thanks
@Kachukwu Okoh, have you tried table2array()?
Hello @Image Analyst
Yeah table2array() didn’t work. I got an error saying ‘unable to concatenate the specified table variables’
So my data consists of different data types (numerical, categorical and date time) and I have been trying to load it into the workplace as a double to use for data prediction with Neural Network tool and ANFIS
But you said you wanted a dobule format so I assumed you would only use the numerical columns in table2array(). So, since you evidently want to include ALL columns, exactly what do you want to do with the categorical and date time columns? What double do you want to convert those to???
categorical objects are stored according to an internal integer index. You can use methods such as uint8() on the cateogorical objects in order to extract the indices associated with each item.
However, these indices are might not have any relative meaning -- an index of 2 might be in some sense "far" from the entry with an index of 3. Consider for example if the original entries were character vectors of times in AM/PM format, then the 11 AM entry might be beside the 11 PM entry in sorted order.
When the categorical object is constructed, you can give a value to be associated with each category.
But if you are expecting the categorical objects to have relative meaning to be computed on, not just arbitrary class labels that have no inherent meaning, then you should consider creating the categorical objects with "ordinal" setting: you can do arithmetic on those. Such as subtracting the first category for the current entry to find the relative offset.
To convert datetime objects for use, you should pick a consistent base time, and subtract it from your datetime objects. The result will be a duration() object. You can extract numeric information from those such as by asking days() of the duration to get a floating point number measured in days.

Iniciar sesión para comentar.

Image Analyst
Image Analyst el 11 de Dic. de 2020
Try this:
[numbers, strings, raw] = xlsread('trainingdata.xlsx');
numbers is your double array.

Categorías

Etiquetas

Preguntada:

el 11 de Dic. de 2020

Comentada:

el 13 de Jun. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by