how to create .Mat file from scratch
Mostrar comentarios más antiguos
Hi
Could you please assist on the process to create a .mat file on Matlab for version R2022a, thanks
14 comentarios
John D'Errico
el 28 de Dic. de 2022
Editada: John D'Errico
el 28 de Dic. de 2022
Is your question how to write a .mat file using a tool like save? If so, then just read the help for save, or read the examples shown.
If your question is how could you write a .mat file as a binary file where you open the file then dump stuff into the file as a binary stream, then no, we can't help you.
Your wording, "From scratch" would imply you want to learn how to write the .mat file, without using a tool like save. But it is not at all clear.
Stephen23
el 28 de Dic. de 2022
MAT file format versions 4 and 5 are described in detail here:
Ajay
el 29 de Dic. de 2022
Image Analyst
el 29 de Dic. de 2022
Editada: Image Analyst
el 29 de Dic. de 2022
@Ajay when did you last see it? Who gave it to you or where did you get it from? Or did you make it yourself and "lost" it? Did you check your recycle bin?
Ajay
el 29 de Dic. de 2022
Walter Roberson
el 3 de En. de 2023
In a situation such as this, the first thing I would do would be to try to define what it is that the slider is intended to control.
You would not use a slider to control the rules of a Fuzzy Inference Engine. You might use a slider to control a constant signal, or to control a parameter such as the magnitude of a Gain block -- but your model does not have anything like those.
Ajay
el 4 de En. de 2023
Walter Roberson
el 4 de En. de 2023
Since the sliders described above control parameters or variables, you could (if needed) have them control the value of a Constant block that was being fed into the Temperature or whatever block as the input signal.
Ajay
el 5 de En. de 2023
Walter Roberson
el 5 de En. de 2023
If I recall correctly triangles with -K- are Gain blocks not constant blocks. And you have no signal feeding the Gain blocks so probably you are magnifying zeros, getting zeros.
Ajay
el 5 de En. de 2023
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.
Respuesta aceptada
Más respuestas (1)
Atsushi Ueno
el 28 de Dic. de 2022
Movida: Image Analyst
el 29 de Dic. de 2022
a = 123; b = 456.789;
whos % variables a and b are displayed
save test.mat
clear all
whos % nothing is displayed
load test.mat
whos % variables a and b are displayed again
Categorías
Más información sobre Fuzzy Logic in Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!