How can i load a .mat file from a gui and store its contents (3 rows of numbers) into a matrix?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de Dic. de 2011

1 voto

2 comentarios

Raldi
Raldi el 4 de Dic. de 2011
Lol Walter sorry for all these questions. I figured it myself though
used
NAME = [Path_Name,File_Name];
struct=load(NAME);
structnames = fieldnames(struct, '-full');fiields in the struct
k=length(structnames);
for i=1:k
namevar=strcat('struct.',structnames{i});
value=eval(namevar);
assignin('base',structnames{i},value);
end
Now my only problem is how to make a large gui record sound from the microphone and play it after i apply some filters to it. But thats another story
Walter Roberson
Walter Roberson el 4 de Dic. de 2011
The eval is totally unneeded.
http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F

Iniciar sesión para comentar.

Más respuestas (1)

ali hamadi
ali hamadi el 16 de Feb. de 2017

0 votos

Hi everyone ,
i am new in MATLAB , and i have done my project in it and now i need to create a GUI for my project.
using the GUI , i should be able to have the following things : in my project i have 2 different channels with their results. ( AWGN , BEC )
in each channel for example : AWGN , i have different SNR from 0.5 till 3.5.
in each value of the SNR , i have different code length values like : ( 8,16,32,64,128,256,512,1024,2048)
for each code length i have stored results .MAT file , in that file i need to extract a variable called indeces(order of numbers) , and then do some calculation ( show the first 10% , 20% , 30% ...100% of that variable indeces in a txt.file.
so the main idea is : select the channel type , select the SNR values , select the CODE LENGTH , choose the percentage , after that show the results in a .txt file so how to link all the above options together with the right results file. your help is appreciated and helpful...
Regards

3 comentarios

Walter Roberson
Walter Roberson el 16 de Feb. de 2017
ali, please create a new Question for this.
Are there a number of different .mat files, or is all of the data in the same .mat file? How do you determine which .mat file to use or which variable name to use?
ali hamadi
ali hamadi el 20 de Feb. de 2017
yes there are different number of .mat file, for each type of : channel , SNR , CODELENGTH
ali hamadi
ali hamadi el 23 de Feb. de 2017
Dear Walter ,
sorry for disturbing you , but i really need your help. now i have all the needed variables in one .mat file. still need to link between the conditions : CHANNEL TYPE , SNR/PE , CODE LENGTH , AND the needed variable. like : channel type : AWGN , SNR : 3.5 : CODE LENGTH : 2048 ===>> SHOW THE RESULTS OF THAT VARIABLE : AWGN_2048_1MI_35.MAT

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 4 de Dic. de 2011

Comentada:

el 23 de Feb. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by