New Reply

Matlab fprintf "%" usage in output data

 
Share Thread Thread Tools
Sep18-12, 08:48 PM   #1
 

Matlab fprintf "%" usage in output data


I want to save data into a textfile, but I will again need matlab to read that text file, in which
case, I would like to have my header-text of the data table begin with '%"
so that when I am reading from than file, matlab will ignore header.

I am getting error in doing so. Can somebody please help me ?

thank you !
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> King Richard III found in 'untidy lozenge-shaped grave'
>> Google Drive sports new view and scan enhancements
>> Researcher admits mistakes in stem cell study
Sep18-12, 11:31 PM   #2
 
Blog Entries: 1
Recognitions:
Gold Membership Gold Member
Homework Helper Homework Help
Science Advisor Science Advisor
If I understand correctly, you are encountering an error when trying to print the % symbol using fprintf. That is because % has a special meaning to fprintf. It is used for formatting numbers. If you want to print the symbol itself, you have to put %% instead of %. Example:

fprintf(fid, '%% this is a comment\n');
Sep19-12, 07:34 PM   #3
 
Perfect ! this did help me. I Was trying to print "%". and %% is the solution thanks again
New Reply
Thread Tools


Similar Threads for: Matlab fprintf "%" usage in output data
Thread Forum Replies
Meaning of "Scaled" and "Inverted" in context of picoammeter analog voltage output Electrical Engineering 3
Matlab "solve" function in "for" loops Math & Science Software 4
CSE 1010 - MATLAB - User-Controlled Input and Output - fprintf Engineering, Comp Sci, & Technology Homework 0
extract data from a "huge" file using matlab Math & Science Software 1
can u make "if A>=B then output=1 Else output=0" using these logic gates? Advanced Physics Homework 7