回答済み
generation of random numbers inthe specified range ?
your_vals = 8.75 + (9.50 - 8.75).*rand(100,1);

13年以上 前 | 0

回答済み
Figures displaying differently in and out of MATLAB
In order to preserve appearance, you could use a vector graphics format, such as .svg or .eps, instead of .png which is a bitmap...

13年以上 前 | 1

| 採用済み

回答済み
Ploting A square around minima of a matrix
x = rand(100,1); y = rand(100,1) [idx idx] = min(y); plot(x,y,'.') hold on; plot(x(idx),y(idx),'s','MarkerSize'...

13年以上 前 | 0

回答済み
decrease num of for loops
old_v = 0; for ii = 1:8*8*8*8 [u v x y] = ind2sub([8 8 8 8],ii); u = u-1; v = v-1; x = x-1; y = y-1; ...

13年以上 前 | 0

回答済み
Run an M-file multiple times
for ii=1:1000 your_m_file_name %the .m is not necessary end Provided you are in the directory your m-file resides...

13年以上 前 | 0

| 採用済み

回答済み
Problem when assigning vectors
b = zeros(numel(f),1);

13年以上 前 | 1

回答済み
need a time series
totHours = 72; totMin = 12; totSec = 21; totVals = totHours*60*60+totMin*60+totSec; hour_vec = cell2mat(arra...

13年以上 前 | 3

| 採用済み

回答済み
Weird spaces undetected by strfind
This sounds like an encoding problem. To find out what encoding your installation of Matlab uses: feature('DefaultCharacte...

13年以上 前 | 2

回答済み
Generate random's number?
nVals = numel(your_stream); your_val = your_stream(randperm(nVals,1));

13年以上 前 | 1

回答済み
How to compare a matrix row by row with specified condition
Maybe not the most efficient thing around, but here goes: A=[ 5 0 10 15 0.021 5 0 15 20 0.011 10 15 ...

13年以上 前 | 0

| 採用済み

回答済み
How to output as a vector
Still <http://www.mathworks.com/matlabcentral/answers/51950-coin-toss-game-simulation going at it>. What's the meaning of _N ...

13年以上 前 | 0

| 採用済み

回答済み
datenum with time in time vector
I don't think you get the same number. Try diff(tt) and you will see that they are different. Also, use f...

13年以上 前 | 0

| 採用済み

回答済み
transform a cell in a column
A = cell2mat(A);

13年以上 前 | 0

回答済み
How to plot multiple qqplot (Observed vs. Simulations) on same single figure with same regression line?
You can't. Why would you want to do that? Even if you could, what would the meaning be? It's not a regression line. A straight l...

13年以上 前 | 0

| 採用済み

回答済み
Can these operations be vectorized?
There are ways, but it will probably be slower. For loops are not necessarily bad. Look at the answer <http://www.mathworks.com/...

13年以上 前 | 0

回答済み
what kind function of this? Fit Constant Probability?
_constProb_ is not a built-in function. You can look at the source code yourself edit constProb Or you can post it her...

13年以上 前 | 1

| 採用済み

回答済み
how to add string matrix to numeric matrix?
You could use cell arrays: a={'rice';'corn';'wheat'}; b={3;4;3}; your_result = cellfun(@(a,b) [a ' ' num2str(b)],a,b,...

13年以上 前 | 0

回答済み
systematic: Do not use global, don't use eval
In small programs it's not a problem. If you are the only one that will be ever using your code, it should not be a problem. It ...

13年以上 前 | 3

回答済み
Returning which button was pressed.
f = figure(1); click_type=get(f,'SelectionType'); if strcmp(click_type,'normal') %right click %Do some stuff el...

13年以上 前 | 0

| 採用済み

回答済み
How can I select all the nonzero elements of a matrix and give out a matrix?
your_mat = A(A~=0); And if you want a sparse matrix: your_mat = sparse(A);

13年以上 前 | 0

回答済み
numerical stable triangulation method?
# No. Both are valid Delaunay triangulations. # None, unless you write it yourself. You could always try the file exchange, may...

13年以上 前 | 0

| 採用済み

回答済み
Is there something wrong with the find function?
From the documentation on the colon operator: j:i:k is the same as [j,j+i,j+2i, ...,j+m*i] In your vector _0.2_ would b...

13年以上 前 | 1

| 採用済み

回答済み
Conversion from uint8 to ascii to number
Somewhat convoluted, depends on whether you can use _sprintf()_ and _sscanf()_: your_ascii = [48 46 56 52]; your_asci...

13年以上 前 | 0

回答済み
Coin toss game simulation.
num_toss = 10; %Toss the coin vec_toss = rand(num_toss,1) > 0.5; %Get the average: mean_vec = cumsum(vec_toss)./(1...

13年以上 前 | 0

| 採用済み

回答済み
Correct plot in matlab
Try: plot(Shear(:,1),Shear(:,2)); If you give a matrix as an argument to _plot()_ it will draw each column as independ...

13年以上 前 | 0

回答済み
how can store two power 1000 value in matlab.
<http://en.wikipedia.org/wiki/Integer_(computer_science) You can't.>

13年以上 前 | 0

回答済み
How can I use an return value from function1 in function2 (different m.files)?
You need to pass returnval1 to fun2: function returnval1 = fun1(input1,input2,input3) %do your stuff function f...

13年以上 前 | 0

回答済み
What can I do to large scale array?
There are two limiters: data type and addressable memory. The data type will affect how much memory is needed. It can be solved ...

13年以上 前 | 0

| 採用済み

回答済み
How do I create a create 'for' loop to compute time, position, velocity and add to running sum?
Indexes in Matlab start with one, not zero. _which_ever_array(0)_ will return an error. In your example, you could, amongst oth...

13年以上 前 | 0

回答済み
Draw uninterrupted lines on a plot with missing values
idx = ~any(isnan(y),1); plot(x(idx),y(idx)); Also, you could use _nanmean()_ to get the mean in the presence of NaN'...

13年以上 前 | 2

| 採用済み

さらに読み込む