app designer readmatrix only 1 row

조회 수: 32 (최근 30일)
Daniel
Daniel 2022년 12월 15일
답변: Kevin Holly 2022년 12월 15일
I need to read the data from a excel starting from C63 and in the same row, to the last column. With writematrix using only ("Range", "C63") I write only in that row to the last column, but with readmatrix with the same ("Range"; "C63") I read from that cell to all the next rows and columns.
I only need to read that first row.
  댓글 수: 1
Daniel
Daniel 2022년 12월 15일
I can take the first row using the index, but I dont know if theres a better way to do it.

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

채택된 답변

Kevin Holly
Kevin Holly 2022년 12월 15일
I would have used a similar approach. This could be faster depending on the size of your data:
prueba = readmatrix(app.filename,'Range','63:63');
prueba2 = prueba(:,3:end);
I am assuming that you don't know the number of columns in the data you are reading.
If you do know, you could just include the letter associated with the column.
prueba = readmatrix(app.filename,'Range','C63:N63');

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by