Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/error in using fscanf

error in using fscanf

PuTI / 2025-01-31
error in using fscanf
Matlab News

I have a script like this:
%Inputing POE
file_01=’POE_0.01.txt’;
fid=fopen(file_01, ‘r’);
FileName_01=fscanf(fid,’%g %g %g’, [3,Inf])’;

Mag_01=FileName_01(:,1); % moment magnitude
Dist_01=FileName_01(:,2); % distance
POE_01=FileName_01(:,3); % probability of exceedance

I = (mod(1:length(Mag_01),30)==1);
Mag = Mag_01(I);
Dist = Dist_01(1:30);

POE_01 = reshape(POE_01,30,15);
marginal(1:15,1) = sum(POE_01);

file_POE = [‘POE_0.5.txt’,’POE_0.2.txt’,’POE_0.1.txt’,’POE_0.05.txt’, …
‘POE_0.02.txt’,’POE_0.01.txt’,’POE_0.005.txt’];

for i = 1:7
file_temp=file_POE(i);
fid=fopen(file_temp, ‘r’);
FileName_temp=fscanf(fid,’%2.2f %g %g’, [3,Inf])’;

POE=FileName_temp(:,3); % probability of exceedance

marginal(1:15,i)=sum(reshape(POE,30,15));
temp=sum(marginal);
hold on

plot(Mag,marginal(1:15,i)/temp(i),’DisplayName’,file_POE(i))
xlabel(‘Magnitude (Mw)’);
ylabel(‘Contribution to the Hazard’);

end
xlim([4.5 8.8])
legend

I got a massage about :
Error using fscanf
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in inputing_data (line 73)
FileName_temp=fscanf(fid,’%g %g %g’, [3,Inf

Is there any one can help?I have a script like this:
%Inputing POE
file_01=’POE_0.01.txt’;
fid=fopen(file_01, ‘r’);
FileName_01=fscanf(fid,’%g %g %g’, [3,Inf])’;

Mag_01=FileName_01(:,1); % moment magnitude
Dist_01=FileName_01(:,2); % distance
POE_01=FileName_01(:,3); % probability of exceedance

I = (mod(1:length(Mag_01),30)==1);
Mag = Mag_01(I);
Dist = Dist_01(1:30);

POE_01 = reshape(POE_01,30,15);
marginal(1:15,1) = sum(POE_01);

file_POE = [‘POE_0.5.txt’,’POE_0.2.txt’,’POE_0.1.txt’,’POE_0.05.txt’, …
‘POE_0.02.txt’,’POE_0.01.txt’,’POE_0.005.txt’];

for i = 1:7
file_temp=file_POE(i);
fid=fopen(file_temp, ‘r’);
FileName_temp=fscanf(fid,’%2.2f %g %g’, [3,Inf])’;

POE=FileName_temp(:,3); % probability of exceedance

marginal(1:15,i)=sum(reshape(POE,30,15));
temp=sum(marginal);
hold on

plot(Mag,marginal(1:15,i)/temp(i),’DisplayName’,file_POE(i))
xlabel(‘Magnitude (Mw)’);
ylabel(‘Contribution to the Hazard’);

end
xlim([4.5 8.8])
legend

I got a massage about :
Error using fscanf
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in inputing_data (line 73)
FileName_temp=fscanf(fid,’%g %g %g’, [3,Inf

Is there any one can help? I have a script like this:
%Inputing POE
file_01=’POE_0.01.txt’;
fid=fopen(file_01, ‘r’);
FileName_01=fscanf(fid,’%g %g %g’, [3,Inf])’;

Mag_01=FileName_01(:,1); % moment magnitude
Dist_01=FileName_01(:,2); % distance
POE_01=FileName_01(:,3); % probability of exceedance

I = (mod(1:length(Mag_01),30)==1);
Mag = Mag_01(I);
Dist = Dist_01(1:30);

POE_01 = reshape(POE_01,30,15);
marginal(1:15,1) = sum(POE_01);

file_POE = [‘POE_0.5.txt’,’POE_0.2.txt’,’POE_0.1.txt’,’POE_0.05.txt’, …
‘POE_0.02.txt’,’POE_0.01.txt’,’POE_0.005.txt’];

for i = 1:7
file_temp=file_POE(i);
fid=fopen(file_temp, ‘r’);
FileName_temp=fscanf(fid,’%2.2f %g %g’, [3,Inf])’;

POE=FileName_temp(:,3); % probability of exceedance

marginal(1:15,i)=sum(reshape(POE,30,15));
temp=sum(marginal);
hold on

plot(Mag,marginal(1:15,i)/temp(i),’DisplayName’,file_POE(i))
xlabel(‘Magnitude (Mw)’);
ylabel(‘Contribution to the Hazard’);

end
xlim([4.5 8.8])
legend

I got a massage about :
Error using fscanf
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in inputing_data (line 73)
FileName_temp=fscanf(fid,’%g %g %g’, [3,Inf

Is there any one can help? error input and read data MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

External Mode Connection Issue with C2000 LaunchPad and Speedgoat System
2025-05-17

External Mode Connection Issue with C2000 LaunchPad and Speedgoat System

how to validate mscohere?
2025-05-17

how to validate mscohere?

Transfer history to MATLAB 2025a
2025-05-17

Transfer history to MATLAB 2025a

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss