I cant figure out how to exclude zero so that when the min velocity and the time the min velocity occurs to not show zero basically I want to show the first velocity and time thats not zero and to display the velocity and time together in a more efficient way??clear; clc;veldata = dlmread('veldata.txt',' ');time = veldata(:,1);velocity = veldata(:,2);if (time > 0) time = time;end [min_velocity,min_ind] = min(velocity);[max_velocity,max_ind] = max(velocity);avg_velocity = mean(velocity);t_minv = time(min_ind);t_maxv = time(max_ind);disp('The min velocity at time = ')disp(min_velocity)disp(t_minv)disp(' The max velocity at time in seconds is = ')disp(max_velocity)disp(t_maxv)disp('The average velocity is: ')disp(avg_velocity)
MATLAB: Help with how to exclude zero and show a more efficient way to display the velocity and time in one line
arraydisplayif statementtext filetext;
Best Answer