Only as a learning record, Gangster skip.
bluetoothread='#-0.115000*-0.205000##-0.115000*-0.175000##-0.115000*-0.155000#;
Bloggers extracts the character '#' and ' ' between the data [Note, not including the extracted 'and data between the' # ']
------------------------------
bloggers find extractBetween
function is not supported in matlab2016a and earlier, preferably with more than matlab2017a the version in order to use this function.
——————————————————————————————
Step:
. 1, extractBetween - (extractBetween cell type data is obtained)
2, cell2mat - cell converted to char Note! A transfer cycle requires a char, and a char is converted into a num, num final and then each structured in an array
3, str2double
code show as below:
clear;close all;clc;
bluetoothread='#-0.115000*-0.205000##-0.115000*-0.175000##-0.115000*-0.155000#;
s=extractBetween(bluetoothread,'*','#')
s=s'
j=1;
for i=1:length(s)
smat=cell2mat(s(i))
snum=str2double(smat)
snumm(j)=snum
j=j+1;
end
After running as shown:
-----------------------------------
reference
Portal
Portal 2