In: Advanced Math
When using the import wizard in MATLAB to import data fro, a .csv file the data appears in MATLAB in the following format "35:53.2" how do I convert this into more usable matlab values? I think that the duration function was used to generate the time format. The code will need to be written in MATLAB software
I will leave feedback if you are able to provide a correct response.
Thank you
%Matlab code to split a string into numbers
clear all
close all
%Here the given form of the string is '35:53.2'
%let we can store it into variable s
s='35:53.2';
% Now we have to split it into individual numbers and store it
into an
% arrey
val(1)=str2double(s(1:2));
val(2)=str2double(s(4:5));
val(3)=str2double(s(7:end));
fprintf('\t The actual imported string is %s\n',s)
fprintf('\n\t After splitting into individual numbers we can
get\n val= ')
disp(val)
%%%%%%%% End of Code %%%%%%%%%%