inserting +- (i.e. \pm) between two numbers in matlab

前端 未结 3 650
南旧
南旧 2021-01-15 04:56

I want to insert the symbol +- (\\pm) between x and y in table created in matlab

x = (1:1:5)\';
y = x*5/100;
table = [x y]

So, that the out

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-15 06:01

    With output as a text file use the format spec for fprintf such as

    FileID=fopen('FileName.txt','w');
    
    fprintf(FileID,['%1.4f ',177,' %1.4f\n'],[x';y'])
    

提交回复
热议问题