フィルターのクリア

I would like to randomly mixed rows from Excel through MATLAB

3 ビュー (過去 30 日間)
Franck paulin Ludovig pehn Mayo
Franck paulin Ludovig pehn Mayo 2022 年 4 月 20 日
コメント済み: Voss 2022 年 4 月 20 日
I am reading data from excel through MATLAB. I would like that each time i run the script , i get my rows to be randoms. But i don't Know how to proceed.
To be more specific, For instance, i would like that when running the script for the first time, my first row could be my 5th row or 15 th row and so on
data = xlsread('excel_data.xlsx');
handles.v_thickness_1 = data(:,1);
handles.v_thickness_2 = data(:,2);
handles.h_thickness_1 = data(:,3);
handles.h_thickness_2 = data(:,4);
handles.v_or_h_array = data(:,6);
handles.exp_counter = 1;
handles.region1 = [];

採用された回答

Voss
Voss 2022 年 4 月 20 日
編集済み: Voss 2022 年 4 月 20 日
data = xlsread('excel_data.xlsx');
% randomly permute the rows of data:
data = data(randperm(size(data,1)),:);
handles.v_thickness_1 = data(:,1);
handles.v_thickness_2 = data(:,2);
handles.h_thickness_1 = data(:,3);
handles.h_thickness_2 = data(:,4);
handles.v_or_h_array = data(:,6);
handles.exp_counter = 1;
handles.region1 = [];
  2 件のコメント
Franck paulin Ludovig pehn Mayo
Franck paulin Ludovig pehn Mayo 2022 年 4 月 20 日
@_ Thank you. It is working perfectly
Voss
Voss 2022 年 4 月 20 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by