Xticks single or double values increase
19 ビュー (過去 30 日間)
古いコメントを表示
When I try to run this:
figure
H1 = gca;
plot(time,Session2audvis_audL_avg_src,'r--o')
hold on
plot(time,Session1audvis_audL_avg_src,'g')
xticks([0 .025 .05 .075 .1 .125 .15 .175 .2 .225 .25 .275 .3 .325 .35 .375 .4 .425 .45 .475 .5 .525 .55 .575 .6 .625 .65 .675 .7 .725 .75 .775 .825 .85 .875 .9 .925 .95 .975 .1])
xtickslabels(['0', '.025', '.05', '.075', '.1', '.125', '.15', '.175', '.2', '.225', '.25', '.275', '.3', '.325', '.35', '.375', '.4', '.425', '.45', '.475', '.5', '.525', '.55', '.575', '.6', '.625', '.65', '.675', '.7', '.725', '.75', '.775', '.825', '.85', '.875', '.9', '.925', '.95', '.975', '.1'])
%axis([-inf, inf, axis_min, axis_max])
title('Session audvis audL')
I recieve this error:
>> untitled5
Error using xticks (line 33)
Value must be a vector of type single or double whose values increase
Error in untitled5 (line 244)
xticks([0 .025 .05 .075 .1 .125 .15 .175 .2 .225 .25 .275 .3 .325 .35 .375 .4 .425 .45
.475 .5 .525 .55 .575 .6 .625 .65 .675 .7 .725 .75 .775 .825 .85 .875 .9 .925 .95 .975
.1])
0 件のコメント
回答 (1 件)
Steven Lord
2020 年 4 月 24 日
Look at the last two elements of the vector you're passing into xticks. Is the last element greater than the next-to-last element?
Rather than manually typing out each element I'd use the colon operator with a starting value, an increment, and an ending value to generate that vector.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Polar Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!