there is print error
Afficher commentaires plus anciens
clear all
format long;
NumBand=13;
NumK=301;
fid=fopen('mos2_bs.txt');
linetmp = fgetl(fid);
linetmp = fgetl(fid);
linetmp = fgetl(fid);
line = textscan(fid,'%s %s %s %s %f %s',1);
linetmp = fgetl(fid);
linetmp = fgetl(fid);
linetmp = fgetl(fid);
linetmp = fgetl(fid);
linetmp = fgetl(fid);
line = textscan(fid,'%s %s %s %s %s %s %s %s %s %s %s %f %s %s %s %s',1);
KK=line{12};
line = textscan(fid,'%s %s %s %s %s %s %s %s %s %s %s %s %s %f %s',1);
G=line{14};
line = textscan(fid,'%s %s %s %s %s %s %s %s %s %s %s %s %f %s',1);
M=line{13};
line = textscan(fid,'%s %s %s %s %s %s %s %s %s %s %s %f %s %s',1);
KKK=line{12};
linetmp = fgetl(fid);
linetmp = fgetl(fid);
for whichBand=1:NumBand
linetmp = fgetl(fid);
linetmp = fgetl(fid);
linetmp = fgetl(fid);
linetmp = fgetl(fid);
for whichK=1:NumK
line=textscan(fid,'%f %f %s %s %s',1);
K(whichK)=line{1};
Energy(whichK)=line{2};
end
plot(K,Energy,'k','LineWidth',1);
hold on
end
Emin=-3;
Emax=3;
Kmin=0;
Kmax=1;
axis([Kmin Kmax Emin Emax]);
set(gca,'Fontsize',18);
ylabel('Energy[eV]','fontsize',22);
set(gca,'YTick',Emin:(Emax-Emin)/10:Emax);
set(gca,'XTick',[KK G M KKK]);
set(gca,'XTickLabel',{'K','G','M','K'});
set(gca,'ytick',[-3.0 -2.5 -2.0 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3])
% figure back ground to white
set(gcf, 'color', [1 1 1])
print -dtiff -r300 200310_MFM_0eV
there is error in 'print -dtiff -r300 200310_MFM_0eV'
다음 사용 중 오류가 발생함: matlab.graphics.internal.name (line 101)
출력 파일 '.\200310_MFM_0eV.tif'을(를) 만들 수 없습니다.
오류 발생: print (line 71)
pj = matlab.graphics.internal.name( pj );
오류 발생: HR (line 60)
print -dtiff -r300 200310_MFM_0eV
how can i solve this?
2 commentaires
Image Analyst
le 23 Août 2020
Step 2: Attach 'mos2_bs.txt' so we can try your code.
Step 3: Wait for an answer.
SukHyeong Youn
le 23 Août 2020
Réponses (1)
Cris LaPierre
le 24 Août 2020
The runs without error on my computer and successfully creates the tiff file named in the print statement.
The error message translates to
An error occurred while using: matlab.graphics.internal.name (line 101)
Unable to create output file'.\200310_MFM_0eV.tif'.
Error occurred: print (line 71)
pj = matlab.graphics.internal.name( pj );
Error occurred: HR (line 60)
print -dtiff -r300 200310_MFM_0eV
The most likely reason is that you are trying to save the file to a folder you do not have write permissions to. Other reasons might be because the file already exists but it unaccessible (open) or write protected.
1 commentaire
SukHyeong Youn
le 24 Août 2020
Catégories
En savoir plus sur PDE Solvers dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!