Any one can help me

댓글 수: 5

John D'Errico
John D'Errico 2023년 1월 30일
If you want help, you need to show what you are doing. Tell us what is your question about MATLAB? Instead of just pleading that you have a general problem and need help.
So show your code. Show what error you got, or why you think there is a problem in that code i it does not generate an error. If it does generte an error, then show the complete error message, thus everything in red.
Ao Mohamed
Ao Mohamed 2023년 1월 30일
Jan
Jan 2023년 1월 30일
@Aya Emam: Please post code and error messages as formatted text, not as a foto. Then it is easy to use the original code by copy&paste to post an answer.
John D'Errico
John D'Errico 2023년 1월 30일
Now that you have actually shown some code, there is still a problem. The error message tells us that your file is not what you think it contains. But we have no idea what the file truly does contain.
Finally, you need to understand that posting a PICTURE of your code is not useful. That forces someone who might help you to ttype in your code from the screen.
Is there a good reason why you want to make it more difficult to get help? Paste in the actual code. Attach the file so that someone can understand what is inside the file that you could not read.
Ao Mohamed
Ao Mohamed 2023년 1월 30일
clear all; %#ok<CLALL>
close all;
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A=dlmread('Book5 measured - Copy (2).csv');
x=A(:,1); % it contains frequency column
y=A(:,2); % it contains Peak gain for phi=0 and theta=90 coloumn which is 2nd column.
plot(x,y,'-r','LineWidth',1,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',13)
hold on
This the code
and This is error
Trouble reading 'Numeric' field from file (row number 1, field number 1) ==> "2.000000000000000E+009
","-1.893568374385968E+001 "\n
Error in comaesion11 (line 5)
A=dlmread('Book5 measured - Copy (2).csv');
and this is the excel sheet

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2023년 1월 30일

0 개 추천

dlmread cannot handle the double quotes around the numbers. Use modern import functions instead, e.g. readmatrix(). The option 'TrimNonNumeric' might be useful.

댓글 수: 1

Ao Mohamed
Ao Mohamed 2023년 1월 30일
can you give me example for the read matrix
this is the code
clear all; %#ok<CLALL>
close all;
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A=dlmread('Book5 measured - Copy (3).csv');
x=A(:,1); % it contains frequency column
y=A(:,2); % it contains Peak gain for phi=0 and theta=90 coloumn which is 2nd column.
plot(x,y,'-r','LineWidth',1,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',13)
hold on

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2023년 1월 30일

댓글:

2023년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by