how sort data in the excel

조회 수: 15 (최근 30일)
Life is Wonderful
Life is Wonderful 2023년 9월 17일
댓글: Image Analyst 2023년 9월 17일
Hi there,
I'm looking for assistance sorting data ( increasing and decreasing order ). I've attached a spreadsheet, and I'd like to order the mean, standard deviation, and variance values as well as the filename.
I need advice on the strategy using the sample code I've attached below.
Thank you
filename = "sort_dataset.xlsx";
sheet = 1;
xlRange = 'A1:E253';
[num,txt,raw] = xlsread(filename,sheet,xlRange)
  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2023년 9월 17일
So you want to sort the data by mean and store the corresponding filenames, and do the same for standard deviation and variance?
If not, then please specify what is the output you want to obtain.
Life is Wonderful
Life is Wonderful 2023년 9월 17일
Yes, you have understood the problem definition correctly.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2023년 9월 17일
편집: Image Analyst 2023년 9월 17일
Try this:
filename = "sort_dataset.xlsx";
% Read data into a table variable.
t = readtable(filename)
% Sort table in order of increasing meandata
t2 = sortrows(t, 'meandata','ascend')
% Sort table in order of decreasing meandata
t3 = sortrows(t, 'meandata','descend')
% Sort table in order of increasing stdddata
t4 = sortrows(t, 'stdddata','ascend')
% Sort table in order of decreasing stdddata
t5 = sortrows(t, 'stdddata','descend')
% Sort table in order of increasing vardata
t6 = sortrows(t, 'vardata','ascend')
% Sort table in order of decreasing vardata
t7 = sortrows(t, 'vardata','descend')
% Sort table in order of increasing FileName
t8 = sortrows(t, 'FileName','ascend')
% Sort table in order of decreasing FileName
t9 = sortrows(t, 'FileName','descend')
  댓글 수: 8
Life is Wonderful
Life is Wonderful 2023년 9월 17일
편집: Life is Wonderful 2023년 9월 17일
Histogram -Gaussian Fit
Zoom figure
Image Analyst
Image Analyst 2023년 9월 17일
OK. Do you need anymore help? I think I answered all your questions.
If this Answer solves your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by