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

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

Answers (1)

This will be the your answer.
if true
misvar = xlsread('mistry.xls');
misvar(1,1)=""; % empty string
end

4 Comments

well it works, while it is writing to the txt file it is writing the first element as NAN, is there any way to just leave it blank, the reason is this output file, is going to be input for some other application which just accepts numbers, I am attaching the output.
This is the command to leave it blank.
if true
misvar =xlsread('mistry.xls');
misvar(1,1)=[];
end
But, we can't do that. Reason is there in below link.
https://in.mathworks.com/matlabcentral/answers/287786-a-null-assignment-can-have-only-one-non-colon-index-when-i-eliminated-elements-of-matrix
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)= [];
For that only I attached reason in the above link.

This question is closed.

Asked:

on 21 Aug 2018

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!