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 8021345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:57:09+00:00 2026-06-04T21:57:09+00:00

function [org_data] = file_manipulation(in_fname, txt_fname, mat_fname) org_data = round(load(in_fname)); fid = fopen(txt_fname,’wt+’); student_id =

  • 0
function [org_data] = file_manipulation(in_fname, txt_fname, mat_fname)
    org_data = round(load(in_fname));

    fid = fopen(txt_fname,'wt+');
    student_id = '9900';
    txt = [txt_fname ' : ' student_id '\nDate of creation:' datestr(now,'dd/mm/yyyy')]; 
    fprintf(fid,'%s',txt);

end

Instead of inserting a newline the file generated is:

C:\w2\test1.txt : 9900\nDate of creation:30/05/2012

What’s the problen with my code?

  • 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-04T21:57:11+00:00Added an answer on June 4, 2026 at 9:57 pm

    Use sprintf to make those strings:

    fprintf(fid, sprintf('%s : %s\nDate of creation: %s', txt_fname, student_id, datestr(now,'dd/mm/yyyy')));
    

    The way you’re doing it now, it treats the backslash as a literal.

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

Sidebar

Related Questions

From: http://ejohn.org/apps/learn/#2 Function.prototype.bind = function(){ var fn = this, args = Array.prototype.slice.call(arguments), object =
function sc_HTMLParser(aHTMLString){ var parseDOM = content.document.createElement('div'); parseDOM.appendChild(Components.classes['@mozilla.org/feed-unescapehtml;1'] .getService(Components.interfaces.nsIScriptableUnescapeHTML) .parseFragment(aHTMLString, false, null, parseDOM)); return parseDOM;
I'm trying to replicate the function seen here: http://en.wikipedia.org/wiki/Window_function#Blackman.E2.80.93Harris_window But I simply can't get
Hi i can define functions like this for el: <function> <function-name>areAllGranted</function-name> <function-class>org.springframework.faces.security.FaceletsAuthorizeTagUtils</function-class> <function-signature>boolean areAllGranted(java.lang.String)</function-signature>
Function RRel(colmn, Optional offst, Optional rng) If offst Is Nothing Then Set offst =
I am trying to call a servlet from jQuery's .ajax() function. At the moment
That's pretty much it. I've got a function to set up an OpenAL context
From http://pubs.opengroup.org/onlinepubs/009604599/functions/pipe.html : The pipe() function shall create a pipe and place two file
I have a function that need RSA encryption/decryption. With provided .pem file, that contains
I am trying to use the getJSON function in jQuery to import some data

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.