Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Deletion of first element from excel while writing that in to txt file

1 回表示 (過去 30 日間)
raghavendra kandukuri
raghavendra kandukuri 2018 年 8 月 21 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi, I have an excel with 2 columns, I am reading this file from .m file and through dlmwrite, writing it to the note pad but I want to skip the first element when ever it writes to the note pad with empty string or blank but not with the second element.
misvar = xlsread('mistry.xls'); m1=misvar(:,1); m1=m1'; dlmwrite('PRM.txt',m1,'delimiter','\t','-append','newline','pc');
output file is also attached to the above question, I wan to skip value 300(first element in the output) and leave it blank
  2 件のコメント
Image Analyst
Image Analyst 2018 年 8 月 21 日
You forgot to attach the input file 'mistry'xls'.
raghavendra kandukuri
raghavendra kandukuri 2018 年 8 月 21 日
this is that file

回答 (1 件)

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy 2018 年 8 月 21 日
This will be the your answer.
if true
misvar = xlsread('mistry.xls');
misvar(1,1)=""; % empty string
end
  4 件のコメント
raghavendra kandukuri
raghavendra kandukuri 2018 年 8 月 21 日
It does not work either, it is throwing the following error:
A null assignment can have only one non-colon index.
Error in untitled>pushbutton3_Callback (line 225) misvar(1,1)= [];
Yuvaraj Venkataswamy
Yuvaraj Venkataswamy 2018 年 8 月 21 日
For that only I attached reason in the above link.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by