How to Find a slope

3 views (last 30 days)
Utsav Dobhi
Utsav Dobhi on 6 Jul 2020
Commented: Image Analyst on 6 Jul 2020
d = 'E:\\ \\ DummyFile\\';
filePattern = fullfile(d, 'Run*');
file = dir(filePattern)
n = length(file)
for k = 1:n
baseFileName = file(k).name;
FullFileName = fullfile(d, baseFileName, 'dummy.csv');
temp = readtable(FullFileName, 'ReadVariableNames' true, 'ReadRowsNames' true);
x(:, :, k) = temp(:, :);
end
%Finding Average and Std
Avg = mean(x,3);
Standard_deviation = std(x,0,3)
  4 Comments
dpb
dpb on 6 Jul 2020
AVG = mean(x,3) gave me 96x24x30
Standard_deviation = std(x,0,3) gave me 96x24x30.
That doesn't seem right -- you built a 3D array from the 2D temp array by adding each to the next plane then did a calculation over the 3rd dimension -- that should reduce to one plane in the 3rd dimension.
Also, you've still not defined what you want the slope of with respect to what's the "x" and what's the "y"?
Image Analyst
Image Analyst on 6 Jul 2020
Just before you do that, do this
whos x
and tell us what it spits out to the command window.

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!