Answered
anyone pls give me a detailed description of what this code is doing ??? thxx
As Andrew suggested, use doc 'functioname' to understand with more details: Generate a row vector with numbers going from 0 to...

15 years ago | 1

| accepted

Answered
how to write a function for iterative check between a randsample value and a fixed value.
function y = myRandSmpl(sim, x) y = randsample(sim,1); while y < x y = randsample(sim,1); end end ...

15 years ago | 0

| accepted

Answered
What is missing from MATLAB?
Axes properties should be kept independent and the level of customization should be similar to excel. - For instance, when m...

15 years ago | 2

Answered
How to Add Multiple Arrays?
If you could know how many matrices you have in advance (num), then preallocate before the loop: dir1='C:\Documents and Setti...

15 years ago | 2

| accepted

Answered
95% confidence interval of the mean of a populationsample
If the sample follows a particular distribution and you have the stats TB, then you can estimate the parameters with the confide...

15 years ago | 0

| accepted

Question


Boxplot: second Y axes labels
How can i put the same labels also on both left and right Y axes (tried several solutions but can't make them work as I wish)? ...

15 years ago | 4 answers | 0

4

answers

Answered
error in using cell2mat function while the level of decomposition is greater than 1
You *can* do: c = {1, 2, 3}; c = {[1;2], [2;3], [3;4]}; cell2mat(c) You *can't* do: c = {[1;2], 2, 3}; c = {{1} ...

15 years ago | 0

Question


isequal fails with equal structs
v(1).a{1}=sparse(magic(3)+2i*magic(3)); v(2).a{2}={struct('FA',{'a','bb'},'FB',{magic(5),{}})}; v(2).b{2}=@(x) sind(x); ...

15 years ago | 1 answer | 0

1

answer

Answered
Read Text File into a Matrix
% read in data fid = fopen('filepath'); data = textscan(fid,'%f%f%f%f','HeaderLines',2,'CollectOutput',1); data = dat...

15 years ago | 3

| accepted

Answered
Replace value in matrix
You can obtain: A = [0 0 143 143 152 0 0 0 0 151 0 0 0 0 143]; regexprep(evalc('A'), '0', ...

15 years ago | 0

| accepted

Answered
Plotting an unknown number of lines in different colours
I suggest to store _x_ and _y_ in different matrices and to call: plot(x,y) Or with your data: results = rand(20,...

15 years ago | 0

| accepted

Answered
Cell editable callback
I don't know why you've chosen that way, but if you have a figure with a uitable in it: % Create uitable uitable('Data',mag...

15 years ago | 0

| accepted

Answered
Different kind of normalization
% Create standard normal distributed samples with std = 100; A = randn(100000,10)*100; % Normalize B = bsxfun(@rdivid...

15 years ago | 0

| accepted

Answered
To RESHAPE the number of elements must not change
It means that prod([1 DS(2:end)]) ~= numel(mlsig) i.e. you cannot have 10 elements vector and reshape it into a 3 by 5 ...

15 years ago | 2

Answered
about gui
Give a look at *<http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples 41 complete gui examples>*. ...

15 years ago | 0

Answered
Storing Large data in matlab files
Do you get out of memory problems? Otherways you're gonna slow down the computation with I/O operations. You can also gain ...

15 years ago | 0

| accepted

Answered
I can"t see the upper axe limit in pde toolbox.
It's a bug <http://www.mathworks.com/support/bugreports/647227> edit pdetool Substitute line 107 with: axheight = axwidth...

15 years ago | 0

| accepted

Answered
Select a line object using the mouse
Yes, use the ButtonDownFcn to set a function which retrieves the value of the handle and throws it into the workspace with evali...

15 years ago | 0

Answered
multi dimensional plot..
What about *<http://www.mathworks.com/help/toolbox/stats/boxplot.html boxplots>* with one box per time? This way you'll capture...

15 years ago | 0

Answered
Empirical Ortgogonal Functions in matlab
20 * 20 * 100 * (8 bytes) = 312.5 kilobytes Really tiny, 300 MB would be huge for a standard 4gb 32bit achitecture. Oleg

15 years ago | 0

Answered
how to find a point in a dynamic array
Look at the second output of max: [m,idx] = max(array); idx-2 Oleg

15 years ago | 0

Answered
How to make this data make sense graphically
See if you like the concept: A = [... 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 1.4082 1.4082 1...

15 years ago | 0

Answered
Loops in Matlab
Day2(t,:) == [50.3779, -4.1227] How did you get those values? If you simply copy pasted the results from teh command window...

15 years ago | 1

Answered
Sort stocks into portolios based on stock characteristics
I had to write some time ago a function to generate the Carhart (1997) model for assessing mutual fund performance. Here I give...

15 years ago | 0

| accepted

Answered
How do I color an area between 3 graphs ?
You can use the *<http://www.mathworks.com/help/techdoc/ref/fill.html fill>* function: fill(X,Y,ColorSpec) Or look at th...

15 years ago | 0

Answered
Directory Watcher
You can use *<http://www.mathworks.com/matlabcentral/fileexchange/29198-foldersizetree recursive directory listing>* in the foll...

15 years ago | 1

| accepted

Answered
How to make histogram not showing zeroes ?
If you want to include numbers which are > 0: A = [0 1 0 3 5 0 1 3 0 0 0 4]; idx = A > 0; hist(A(idx)) Otherwise...

15 years ago | 3

| accepted

Answered
How do I pass a vector into a user-defined function?
You have to use: * ./ * .* * .^ whenever the operation involves TWO arrays of the same dimension to obtain elementwis...

15 years ago | 2

Answered
How increase bufsize for importdata
You can try to edit line 319 of importdata: bufsize = min(1000000, max(numel(fileString),100)) + 5; Set the minimum threshol...

15 years ago | 1

| accepted

Answered
Probably simple, but can't seem to make it work.
Or to apply on the full matrix: N = 30; REP = 10; tcouple = randi([0 50],N,REP); t = 0:max(tcouple(:))...

15 years ago | 0

Load more