Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:52:30+00:00 2026-06-10T12:52:30+00:00

the code below displays at the matlab command panel perfectly well fprintf(‘%f\n%f\n%f\n’,MDR,TER,FAR); each variable

  • 0

the code below displays at the matlab command panel perfectly well

fprintf('%f\n%f\n%f\n',MDR,TER,FAR);

each variable is displayed as new line

but when i try this way and check the newly made text file via notepad i don’t see any new lines

fileID=fopen('my_file.txt','w');
fprintf(fileID,'%f\n%f\n%f\n',MDR,TER,FAR);
fclose(fileID);

what might be the problem ? at the text file all variables are written without any new line or space

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:52:32+00:00Added an answer on June 10, 2026 at 12:52 pm

    From the backslash in the filename I assume that you are working on a windows platform. Unix and Windows use different new line characters. Windows uses \r\n as new line while Linux and OSX use \n. Matlab on the other hand uses Unix new lines in the command panel.

    You might want to use dlmwrite to write your text files. This is generally more reliable and faster than fprintf.

    Example:

    dlmwrite('my_file.txt',[MDR;TER;FAR],'newline','pc')
    

    the important part is that the input [MDR;TER;FAR] is a matrix. Every row will be on a new line and the columns are separated by the standard delimeter ,.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code below displays a thumbnail of each image in a specific server directory
Code below works well on Firefox - displays progress bar which progresses on every
The code below displays either M or F in the GridView column after evaluating
The code below first displays folders as hyperlinks, you can click into these folders
In the code below, $row['site'] is an URL. In Chrome and IE8, it displays
I'm a EE newbie. I have the code below. the poll weblog displays at
My code below is supposed to display each question ($_POST[questionText]). For each question, it
I'm using the code below to take a screenshot of all the active displays
I have an application that displays videos. The code below gets a list of
the code below displays a radial gradient filled rectangle. If I un-comment the two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.