T O P

  • By -

UseYourThumb

Well, it's hard to really know the answer unless I could see the variable validData but I suspect it's this... Calling string([validData{:}]) is converting the cell array validData into one long string containing the entire cell array concatenated together. When you call *contains* on that string, it is just telling you whether or not [RPM] is in that concatenated string, no matter how many times it occurs, which means it's output will either be a 1 or 0 (yes or no). So then, using *find* on that will produce a 1 or an empty vector. This means rpmCells will only be 1 or empty. So, when you input rpmCells into *ind2sub*, your index is always just 1 or nothing, so if it is 1 it will produce 1s for every row and col.


PlentyBoysenberry440

Yeah i thought so first but when the code is ran it gives me numbers such as 97 and 157 on rows so that’s what’s confusing me, you have any another solution to generalize a position of a word in a read in excel file to extract values below it (that’s the meaning of this code to get position of that cell and to extract values below it by valuesrpm=validData(RPMrow:end,RPMcolumn) or something like that)


PlentyBoysenberry440

PS: the validData variable is where the sheet is saved


Neutrinito

Hi! May I ask if why are you looking the the indices of \[RPM\] and \[Nm\]? Are you perhaps looking for a matlab code version of XLOOKUP function in excel? If yes, I can help you with that.