How can i write a .ymal file ??

Hi everyone,
i have to write in a .yaml file a vector of cells (first cell is a string, then i have a vector of number values and convert all in cell was a simple solution to have different types of variables in the same vector).
i don't know the extension .yaml and so i hope that someone of you could help me :)
I attach an example of what i'm saying:
signal = x; %vector of double
label = ('signal x'); %string
A = mat2cell(signal, ones(1,size(signal,1)), ones(size(signal,2))); %conversion in cell vector
B = cat(2,label,A); %concat string and cell vector in order to forming a row
%now i have to save B in a file with .yaml as extension
Maybe using .yaml file there is another solution to have label and signal in the same row :)
thank you in advance

 Respuesta aceptada

Walter Roberson
Walter Roberson el 29 de Jun. de 2021

0 votos

https://github.com/ewiger/yamlmatlab can be used to write YAML from MATLAB.

1 comentario

xingxingcui
xingxingcui el 13 de Jun. de 2022
this yamlmatlab can not import and export my yml format. see my attachment

Iniciar sesión para comentar.

Más respuestas (2)

Prakhar Rai
Prakhar Rai el 29 de Jun. de 2021
Editada: Prakhar Rai el 29 de Jun. de 2021

0 votos

As of now MATLAB does not support YAML parsing but you could use third party tools like 'yamlmatlab' for the task.
Please refer to the links: yamlmatlab and yamlmatlab github .
Bill Tubbs
Bill Tubbs el 31 de Mzo. de 2024
Editada: Bill Tubbs el 31 de Mzo. de 2024

0 votos

I find this third-party module by MartinKoch123 works well for reading and writing Yaml files:

Categorías

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

Etiquetas

Preguntada:

el 29 de Jun. de 2021

Editada:

el 31 de Mzo. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by