How to import exponent number from Excel column to MATLAB
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a list of numbers in excel column. I am looking to extract the exponent number (+ - symbol doesn't matter)
For example, in 2^-6 => I want '6'
in 2^-4 => I want '4'
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1137410/image.png)
Thank you for any help you can provide.
댓글 수: 0
답변 (1개)
Chunru
2022년 9월 27일
x = readtable("2powx.xlsx")
y = cellfun(@(a) sscanf(a, "%d^%d")', x.LSB, "UniformOutput", false)
y = cell2mat(y)
y = y(:, 1).^y(:, 2)
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!