how to create .Mat file from scratch

3 visualizaciones (últimos 30 días)
Ajay
Ajay el 28 de Dic. de 2022
Comentada: Walter Roberson el 5 de En. de 2023
Hi
Could you please assist on the process to create a .mat file on Matlab for version R2022a, thanks
  14 comentarios
Ajay
Ajay el 5 de En. de 2023
Hi Sir
So do I include signal gen for each input as well ? as I use the slider to select the desired value input for the sensor as i dont think i can use constant blocks as it not constant values it can be any value as per selection for temp between 0Deg and 100deg Celcius .
Thanking you
Walter Roberson
Walter Roberson el 5 de En. de 2023
I have attached an example.
The second computation in the example, producing "WC", has no basis in any physics; I just needed to put in something to show that the code worked.
To use: carefully click on the red bar of one of the two sliders and drag it. When you have both positioned as desired, click Run and observe the (useless) answer.
You might be able to use the same kind of slider style that you used in your code; the important part of the example is that the sliders are adjusting the parameters of constant blocks and the blocks are then acting as input signals.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de En. de 2023
Editada: Walter Roberson el 3 de En. de 2023
In the designer use writeFIS to create a fis file. Do this ahead of time in a separate session.
In the Fuzzy Logic Controller block specify the name of the fis file
When you use Simulink to generate for a target, Simulink will read the fis file and will generate code that will load in appropriate data structures. You will not need to add any code to read a mat file.
Note that at the time the model is generated for target, the content of the file will be locked in to the model. You will not be able to tune or revise the rules in the deployed model, not without rerunning the deployment process.
So you need an interactive matlab session (with appropriate licenses) to build the fuzzy model. The deployed model is stand-alone and does not need any license to run (so go ahead and copy it to all of your embedded systems), but the flip side is that you cannot adjust the FIS rules in the deployed models.

Más respuestas (1)

Atsushi Ueno
Atsushi Ueno el 28 de Dic. de 2022
Movida: Image Analyst el 29 de Dic. de 2022
You can save variables on your base workspace.
a = 123; b = 456.789;
whos % variables a and b are displayed
Name Size Bytes Class Attributes a 1x1 8 double b 1x1 8 double cmdout 1x33 66 char
save test.mat
clear all
whos % nothing is displayed
load test.mat
whos % variables a and b are displayed again
Name Size Bytes Class Attributes a 1x1 8 double b 1x1 8 double cmdout 1x33 66 char
  2 comentarios
Ajay
Ajay el 3 de En. de 2023
are the above generic variables which I can use ?
Regards
Ajay
Walter Roberson
Walter Roberson el 3 de En. de 2023
You can save and load any variables you have in your workspace. save() is not restricted to only handling variables named a and b

Iniciar sesión para comentar.

Categorías

Más información sobre Fuzzy Logic in Simulink en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by