How can i write a .ymal file ??

조회 수: 45 (최근 30일)
Giorgia Fusaroli
Giorgia Fusaroli 2021년 6월 29일
편집: Bill Tubbs 2024년 3월 31일
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

채택된 답변

Walter Roberson
Walter Roberson 2021년 6월 29일
https://github.com/ewiger/yamlmatlab can be used to write YAML from MATLAB.
  댓글 수: 1
cui,xingxing
cui,xingxing 2022년 6월 13일
this yamlmatlab can not import and export my yml format. see my attachment

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Prakhar Rai
Prakhar Rai 2021년 6월 29일
편집: Prakhar Rai 2021년 6월 29일
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 2024년 3월 31일
편집: Bill Tubbs 2024년 3월 31일
I find this third-party module by MartinKoch123 works well for reading and writing Yaml files:

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by