Extracting values from a cell then converting to a matrix

Hi, i have a cell array A, i want to remove column 1, row 1 and row 2 so that i am left with the other points to analyse.
A = {1x1 missing} {'Pressure'} {[ 0.0136]} {[ 0.0166]} {[ 0.0196]} {[ 0.0226]}
{'Tempera'} {[ 0.0060]} {[ 0.0074]} {[ 0.0087]} {[ 0.0100]} {[ 0.0109]}
{[ 0]} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[ 0]}
{[-0.0070]} {[-0.0095]} {[-0.0119]} {[-0.0130]} {[-0.0138]} {[-0.0140]}
{[-0.0158]} {[-0.0205]} {[-0.0251]} {[-0.0285]} {[-0.0307]} {[-0.0306]}
{[-0.0283]} {[-0.0347]} {[-0.0405]} {[-0.0455]} {[-0.0488]} {[-0.0488]}
{[-0.0442]} {[-0.0522]} {[-0.0552]} {[-0.0573]} {[-0.0588]} {[-0.0595]}
After extracting those values, i want to change them into a matrix and store them in Mat. Below is the code that i used but it gives me wrong answers. Please help.
A(:,1) = [];
A(1,:) = [];
A(1,:) = [];
CurMat = string(A);
Mat = str2double(CurSheetMat);

댓글 수: 1

Thank you, it works. But when i use it for cells that include powers (eg 7.0000e-5) it rounds them off to four decimals, what do i do to store them exactly as they are without rounding off .

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

 채택된 답변

madhan ravi
madhan ravi 2020년 5월 31일
편집: madhan ravi 2020년 5월 31일
A([1,2],:) = [];
A(:,1) = [];
Mat = cell2mat(A)

댓글 수: 3

madhan ravi
madhan ravi 2020년 5월 31일
편집: madhan ravi 2020년 5월 31일
WILLBES BANDA comments:
Thank you, it works. But when i use it for cells that include powers (eg 7.0000e-5) it rounds them off to four decimals, what do i do to store them exactly as they are without rounding off .
Use
format longg % at the beginning
WILLBES BANDA
WILLBES BANDA 2020년 5월 31일
편집: Stephen23 2020년 5월 31일
Works perfectly. Thank you once more honorable!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품

질문:

2020년 5월 31일

편집:

2020년 5월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by