フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Counting zeros gives varying values, how do I change this?

2 ビュー (過去 30 日間)
Franchesca
Franchesca 2014 年 5 月 13 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
This is my code:
%% Import data
numfiles = 54; % number of excel files mydata=cell(numfiles,1); % defining size of mydata d=dir('Trial*.csv');
for i=7:length(mydata) % loop to import mutliple excel files
try
mydata{i} = xlsread(d(i).name); % import files into mydata
catch
disp([d(i).name 'read failed'])
end
myfilename = sprintf('Trial%02d.csv', i); % define file name
mydata{i} = xlsread(myfilename); % import files into mydata
%% Perfrom Calculations
%%Define variables
a= 9.81; % acceleration
fps = 250; % frames per second
%%Calculate Jump Height
no_of_zeros(i,1) = size(mydata{i,1},1) - nnz(mydata{i,1}(:,5)); %number of zeros
no_of_frames = (no_of_zeros(i,1)/4); % number of frames
time = ((no_of_frames/fps)/2); % time up
jumph(i,1)=((a*(time*time))/2); % jump height
Looking at the calculate jump height, it calculates correctly for the first 2 trials but then gives large over estimations for nealry all the other trails. It was a while ago I wrote this could someone clarify this line of code for me as this is where the trouble lies, I'm unsure with the ,1.
no_of_zeros(i,1) = size(mydata{i,1},1) - nnz(mydata{i,1}(:,5)); %number of zeros

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by