回答済み
Plotting exponential curves with random numbers.
Here is something to get you started x = linspace(-10,10,100) ; hold on % help! for k = 1:5, B = 0.15 + (0...

12年以上 前 | 0

回答済み
How to plot number of box plots in a single figure? each box plot is a verctor of variable length.
Here is an example. % Given two column vectors with different lengths V1 = 5 + 10 * randn(7,1) ; V2 = 10 ...

12年以上 前 | 0

回答済み
How to determine samplenumber for fixed distance-intervals?
For examples, I prefer integers, so I upscaled everything by a factor 10. % your data M = [0 1 4 6 8 10 12 14 16 17 18 1...

12年以上 前 | 0

| 採用済み

回答済み
Unsure of how to use and understand rand function
It is always insightful to look at a smaller example: A = [ 4 2 3 1 ; 5 4 2 3 ; 6 7 8 9 ; 1 4 2 5] % just 2-by-2 instead of...

12年以上 前 | 0

回答済み
IF / ELSE Usage within For loop for Specific Iteration Only
As a follow-up, if you only need to perform the statements within a for-loop when the iterator takes specific values, you can ch...

12年以上 前 | 1

回答済み
Do while loop in Matlab
A do-while loop in disguise: while true % statements here % if ~WhileCondition, break ; end end or

12年以上 前 | 22

回答済み
How to replace element matrix with the other matrix?
Even simpler: % example data A = 99 * ones(2,2) B = -1 * ones(6,8) % engine szA = size(A) i0 = (size(B)-sz...

12年以上 前 | 0

回答済み
How to replace element matrix with the other matrix?
To replace the central portion of B with A try this % example data A = 2 * ones(2,2) B = -3 * ones(6,8) % eng...

12年以上 前 | 0

回答済み
Including comments in a .mat file?
Another option might be to use a structure: A.values = [21 22 35] A.label = 'temperature' A.unit = 'degrees Cels...

12年以上 前 | 1

回答済み
Fast matrix multiplication in loop
Two options: 1. *pre-allocate* C to avoid memory allocation in each iteration C = zeros(N, ..) % pre-allocation for ...

12年以上 前 | 0

回答済み
i want all the combinations for [abc]...like abc, ab, ac, bc, a, b, c. can anyone help..Plz...
Take a look at my NCHOOSE function on the File Exchange as it does exactly what you're after. S = nchoose('abc') % S = {...

12年以上 前 | 3

回答済み
How to replace element matrix with the other matrix?
I suggest that you give *a smaller example of A and B* and the required output.

12年以上 前 | 0

回答済み
Help with linear fit
Here's how: tf = x > x1 & x < x2 % true for x1 < x < x2 p = polyfit(x(tf), y(tf),1) % fit on selection

12年以上 前 | 0

回答済み
Finding Consecutive True Values in a Vector
Hide the loops ;-) input = [1 0 1 1 0 0 1 1 1 0 1 0 1 1 1 1 0] [~,~,C] = logicalfind(input,1) ; C = cellfun(@cums...

12年以上 前 | 0

回答済み
use of conditional statement
Here is an example to obtain low intensities. It is often handy to keep the original format and set the elements you are not int...

12年以上 前 | 0

| 採用済み

回答済み
discrete value to binary value
what are discrete values? integers in decimal notation? help dec2bin dec2bin(9)

12年以上 前 | 0

| 採用済み

回答済み
Out of memory error in combination combnk
*Questions* # Do you need them all 1.2652e14 at the same time? (Impossible!) # Do you need only a random fraction of these? ...

12年以上 前 | 1

回答済み
Adding noise with certain standard deviation to uncorrupted data
In addition to Wayne's suggestion you can sample noise from any distribution with unknown parameters and set the standard deviat...

12年以上 前 | 2

回答済み
Import excel file with comma for decimal and dates
In excel and/or in Windows System settings (i do not know where) change the settings of the decimal notation to dot and to the r...

12年以上 前 | 1

回答済み
please help me sort this out
When column number does matter: % A : a N-by-M array % B : a 1-by-N row vector [~, ii] = max(sum(bsxfun(@eq,A,B),2)) ...

12年以上 前 | 1

回答済み
Why the preallocated matrix perform slower in the case below?
You are not doing the same thing, as it takes time to evaluate the indices into ZZn, as well as temporary memory to store them. ...

12年以上 前 | 0

回答済み
Random Binary Sequence Generator
Here are two suggestions: % with 0 <= P <=1 RBS = rand(1,N) < P % will give roughly a proportion of P ones among ...

12年以上 前 | 1

回答済み
concatenate each element of two arrays
A=['a' 'b' 'c'] B = ['1' '2'] C = allcomb(A,B) ALLCOMB can be found here: http://www.mathworks.com/matlabcentral/f...

12年以上 前 | 1

回答済み
How i use a variable name to do a fid=fopen?
Create a function m-file, where you can use a variable. function MyProgram (MyInputFile) % MYPROGRAM (FILE) opens the ...

12年以上 前 | 0

回答済み
Finding values in an Array
Apply some arithmetic: Subject = [126 156 1992 203 186 10 100 100000] Group = fix(Subject ./ (10.^floor(log10(Subject)...

12年以上 前 | 1

| 採用済み

送信済み


LOGICALFIND
Find occurrences of consecutive non-zeros in a vector (v1.0, jan 2014)

12年以上 前 | ダウンロード 1 件 |

5.0 / 5

回答済み
Can you help me solving that?
No need for an explicit loop as you can exploit the power of MatLab with *BSXFUN*. % example data A =[1 2 3 4 5 6 7 ...

12年以上 前 | 0

回答済み
Matrix Multiplications (Altar Output Matrix Size)
Your question is a little confusing. Do you intend to do element-by-element multiplication or matrix multiplication? Assuming...

12年以上 前 | 0

回答済み
change values in a matrix
Another problem needs another solution: a = [0.1234 -1.9876 -2.0001 22.9999] b = a % work on a copy q = ...

12年以上 前 | 0

| 採用済み

回答済み
How does command STEM work for complex numbers?
STEM uses PLOT to make its lines. The documentation of PLOT is clear on complex numbers: _PLOT(Y) plots the columns of Y vers...

12年以上 前 | 0

さらに読み込む