how to create a char

I am trying to follow:
One of the code, said that:
load carsmall
How can I create a file for this "char"
For Others file, i created using excel file and then y=csvread('test10042019.csv');
Capture.PNG
Thank you.

Risposte (1)

Cris LaPierre
Cris LaPierre il 10 Apr 2019

0 voti

You don't have to create a file. carsmall is a mat file. Loading it loads all the variables you need into your workspace.
I just saw your question about reading your Excel file back in. What is it you are trying to do with this example?

8 Commenti

Cris LaPierre
Cris LaPierre il 10 Apr 2019
If you have not yet done so, I strongly recommend you go through MATLAB Onramp. It's a ~2 hour intro to the basics of using MATLAB.
Matlaber
Matlaber il 10 Apr 2019
Thanks for your reply.
What I need is I want to create a file similar to the "carsmall" file which is using my own dataset.
Cris LaPierre
Cris LaPierre il 10 Apr 2019
Modificato: Cris LaPierre il 10 Apr 2019
Create your data in MATLAB, then use the save command to create a mat file of your own containing your data.
Matlaber
Matlaber il 11 Apr 2019
Thanks.
May I know how I can create a data in MATLAB?
In the past, I created my data in csv file and then call csv file in my MATLAB.
Cris LaPierre
Cris LaPierre il 11 Apr 2019
Depends on what your data is. If you need help with this, my recommendation would be to go through at least a couple of the initial chapters in MATLAB Onramp to learn about creating variables and importing data.
Creating it in a csv file and loading it also works. It's just you mentioned wanting to create a file like carsmall, which means you have to first create the variables in MATLAB then save.
Matlaber
Matlaber il 11 Apr 2019
Thanks.
I only want to create a file in carsmall as shown in the figure below:
Capture.png
I do not understand the meaning of the screenshot and do not know, what "in carsmall" means. You can create a char array by:
a = 'hello'
Thanks.
It works
a = 'hello'
Let say I want to do a multiple char
like this below:
Test1
Test2
Test3
Test4
Test5

Accedi per commentare.

Tag

Richiesto:

il 10 Apr 2019

Commentato:

il 11 Apr 2019

Community Treasure Hunt

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

Start Hunting!

Translated by