回答済み
Why am I getting a "Subscript indices must either be real positive integers or logicals" error?
'Cuz you wrote for i = 1:length(x) if ice(i) == 1 N(i)= N(i-1)* .880606541; and _ice(1)_ _is_ 1 so the RHS of th...

9年以上 前 | 0

| 採用済み

回答済み
max and min values in an array
It's the colon operator that's your friend here... mnx=min(x(:)); % doc colon for details of the "magic" here...

9年以上 前 | 3

回答済み
boxplot xticklabel overlapped with xlabel
OK, played some more and got the below... <</matlabcentral/answers/uploaded_files/65337/untitled.jpg>> This was created by...

9年以上 前 | 0

回答済み
boxplot xticklabel overlapped with xlabel
Raise bottom of axes 'position' property if you insist on such large font sizes. Of course, must reduce height the same amount....

9年以上 前 | 0

回答済み
Plotting data with min, max, mean value
See doc boxplot % for starters... *ADDENDUM* I admit I've never used Matlab *boxplot* in anger; let's see...[ponder,...

9年以上 前 | 1

| 採用済み

回答済み
How to plot rows of two matrices in different colors without for loop
Matlab is column-major... plot(x.',y.') will treat each column as an observation automagically. Colors will cycle throu...

9年以上 前 | 0

| 採用済み

回答済み
Dates like 12/31/65 interpreted as 12/31/2065
"Use the pivot, Luke!" >> datestr(datenum('12/31/65','mm/dd/yy')) ans = 31-Dec-2065 >> datestr(datenum('12/31/65','mm/dd...

9年以上 前 | 1

回答済み
How can i find points intersecting x-axis on graph and show them on figure
Either doc find % nearest point (note to look for crossing, not zero) or doc interp1 % interpolated location if not e...

9年以上 前 | 0

回答済み
how to use find to cell cell indexing
Because as your command line shows, grnd_truth_cell{:,1} is a comma-separated list. Enclose it in the [] to make an ar...

9年以上 前 | 2

| 採用済み

回答済み
How to read char '00013' as 13 or '00717' as 717 ? How to skip zero pad ?
>> str2num('00013') ans = 13 >> Or any of the other ways to parse data; *sprintf* or any of the other i/o functions...

9年以上 前 | 0

回答済み
plotyy: problem with ticks
set(ax,{'ylim'},{[minimum_left maximum_left];[minimum_right maximum_right]}) See doc set % for details on syntax for...

9年以上 前 | 0

回答済み
Hi every one ,i wrote a simple code that ask the user for a number as input then convert it to binary and finally perform bitand to get final binary number , but i got an error !,my question is how to convert charactor to an Array or to double ?
Unfortunately, Matlab doesn't have a syntax to enter other base values than base 10 numerically; it appears you want _B_ to be a...

9年以上 前 | 0

| 採用済み

回答済み
read excel files in form of a function
_"but I am missing something."_ function Testing = readfile(a) T = readtable('a','TreatAsEmpty','NA'); ... Ind...

9年以上 前 | 1

| 採用済み

回答済み
Label bars of a histogram
set(gca, 'XTic',binranges) will use the bin values for ticks. It's not as trivial to label the bin ranges as tick labels a...

9年以上 前 | 1

| 採用済み

回答済み
Plot and bar graphs with independent axis
Not too difficult, no... hAx(1)=axes('XAxisLocation','top',... 'YDir','reverse'); bar(rand(10,1)) ...

9年以上 前 | 1

回答済み
I want 4 differnt histograms in one graph but in seprate columns. how can i do this.? they appear as in fig 1 but i want the data to be appear as in fig 2
Arrange the data by row for groups, column for variables...so 3x4 for Fig 2. <http://www.mathworks.com/help/matlab/ref/bar.ht...

9年以上 前 | 0

回答済み
Error in show Semilogy
Well, the two vectors must not be the same length...to plot them against each other, they must be commensurate in size. Let's s...

9年以上 前 | 0

回答済み
Datenum produces different values for the same date in different formats
Because the *datenum/datestr* month,day,year format string values are lower case, not upper. You converted the string represent...

9年以上 前 | 0

| 採用済み

回答済み
Surface Plot Marker Edge Colour
Use hSF=plot(surfacefit,[C(:,Var_1), C(:,Var_2)],C(:,Var_3)); instead to get the handles of the objects created. One of...

9年以上 前 | 0

回答済み
write 10 alphabets in one line
>> sprintf([repmat('%c',1,10) '\n'],'A':'Z') ans = ABCDEFGHIJ KLMNOPQRST UVWXYZ >> *ADDENDUM* Above return...

9年以上 前 | 0

回答済み
max value every n interval
Got the right idea, just can be a little more parsimonious in the implementation... >> [mx,ix]=max(reshape([Data nan(1,mod(...

9年以上 前 | 1

| 採用済み

回答済み
Function variable output name to be the same as input variable name + "_pos".mat
fname=[inputname(1) '_pos']; % doc inputname for details save(fname)

9年以上 前 | 0

回答済み
How do I create density contours on a polar plot?
I was afraid that's what you were looking for -- there's nothing out-of-the-box in Matlab that'll do it. I see the following su...

9年以上 前 | 0

回答済み
How can i compare two strings by their alphabetical order
>> 'a'-'b' ans = -1 >> may give you some ideas??? Or, instead of reinventing the wheel, <http://www.mathworks.co...

9年以上 前 | 0

回答済み
Problem converting cell to string
Well, you've just got to work on writing the proper format string(s) to use when you need them...an example specifically for the...

9年以上 前 | 0

回答済み
How to have labels stick to axis?
xlabel('X Label','rotation', 30) zlabel('Z Label','rotation',-30) Look at the _Text Properties_ section for details of...

9年以上 前 | 0

回答済み
Why am I getting the 'Too many output arguments error'
*error* is a Matlab-supplied function which returns no outputs; hence trying to assign to a LHS fails. See doc error % fo...

9年以上 前 | 0

回答済み
Divide a number by time
Convert the time to lowest common interval; looks like seconds and divide (or, of course, can use whatever time unit desired; mp...

9年以上 前 | 1

| 採用済み

回答済み
How to repeat a for loop n times
Above loop can be simply states=2*(cdf('norm',z,0,1)>rand(size(z)))-1; where _z_ <<-->> AgentZScore To repeat, simply...

9年以上 前 | 0

回答済み
Label x-axes by fraction
Plot first, _then_ set axis properties to other than default ones... XTicks=flip(1./(2:20)); XTickLabel=flip({'1/2','1/3...

9年以上 前 | 2

| 採用済み

さらに読み込む