FREAD() help

조회 수: 3 (최근 30일)
Edward
Edward 2012년 4월 4일
Hi, ive got an array of numbers [2 4 6 8] written into a file by fprintf, Im using n=fread(fid) to get this data from a file,
im getting the numbers [50 32 52 32 54 32 56]
im aware these numbers are ascii format for the numbers in the file,
is there a way i can get the [2 4 6 8] back from these ascii numbers?
Its been suggested that i dont use fprinf but i need to be able to print text aswell as numbers.
thanks

채택된 답변

Wayne King
Wayne King 2012년 4월 4일
A = [50 32 52 32 54 32 56];
B = str2num(char(A));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by