Formatting Data from readmatrix

조회 수: 13 (최근 30일)
Rounak Saha Niloy
Rounak Saha Niloy 2022년 4월 19일
답변: Rounak Saha Niloy 2022년 4월 19일
I have an excel file with name MyExcel.xlsm. The data in "A1:C1" are-
A1 = 236381.358; B1 = 338746.896; C1 = 13.239
I am using the following to formula to read these data from Excel-
Result = readmatrix("MyExcel.xlsm","Range","A1:C1")
The output I am getting is-
Result =
1.0e+05 *
2.3638 3.3875 0.0001
How do I get the result in the format as it is in the excel file? I mean, how do I get it in the following way?
Result =
236381.358 338746.896 13.239
  댓글 수: 1
Stephen23
Stephen23 2022년 4월 19일
Numeric data do not contain formatting information.
You can change how numeric data are displayed by using the FORMAT function.

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

채택된 답변

Rounak Saha Niloy
Rounak Saha Niloy 2022년 4월 19일
Used the following code and it solved my problem.
format longg;
Result = readmatrix("MyExcel.xlsm","Range","A1:C1")

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by