Info

This question is closed. Reopen it to edit or answer.

I'm trying to get the string of names that i received from my previous statement , to write over to my excel spreadsheet but nothing is happening when i press run. I'm unsure what to do next?

1 view (last 30 days)
SystThresh=90 ;
SystThresh1=120;
DiaThresh=60;
DiaThresh1=80;
isOK=(Systolic > SystThresh & Systolic < SystThresh1 & Diastolic > DiaThresh & Diastolic < DiaThresh1);
fprintf('%s is ideal\n',Names(isOK));
xlswrite('BPResults.xlsx',{'Ideal'});
xlswrite('BPResults.xlsx',Names(isOK),'Sheet1','A2');
  3 Comments
Walter Roberson
Walter Roberson on 13 Apr 2018
When you say that Names is a string, do you mean that it is a string() array and indexing it with isOK is intended to return smaller string() array? Or do you mean that Names is a character vector, in which case indexing it with isOK would be choosing individual characters out of the character vector? Or do you mean that it is a cell array of character vectors?
What output is showing up for
fprintf('%s is ideal\n',Names(isOK));
?

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!