回答済み
How to reshape and repeat at the same time.
newdata = reshape(repmat(reshape(data,2,[]),2,1),2,[]);

9年以上 前 | 0

回答済み
How to find the intersection of two curves
You can use a modified version of the Newton-Raphson method for finding the intersection of two parameterized curves, provided t...

9年以上 前 | 0

回答済み
How to find the intersection of two curves
You can convert this into the equations of two slanted ellipses. The first ellipse is: (x-y)^2+(2*x+y)^2 = 5*x^2+2*x*y+2*y...

9年以上 前 | 0

回答済み
Trying to Find the solution of trigonometric equation
Rather than using ‘solve’, you should try ‘fzero’ with various different estimated values for y obtained from doing a plot. Thi...

9年以上 前 | 1

| 採用済み

回答済み
Attempted to access E(3,1); index must be a positive integer or logical. But the index is (3,1) those numbers are both positive. What is going on?
E(t*5,i) has indices that are not always precisely positive integers, because t cannot be precisely equal to all multiples of 0....

9年以上 前 | 0

| 採用済み

回答済み
Can anyone help me in optimizing (maximizing) the function of two variables?
You don’t need matlab to find the maximum value of this function. The subtraction by 398 does not affect maximization, nor does...

9年以上 前 | 2

| 採用済み

回答済み
How to find time of flight
It is possibly easier to think of this problem as having the air stand still and both the transmitter and the receiver moving in...

9年以上 前 | 2

回答済み
i have a problem ,
If the derivatives of f with respect to x, to y, and to z are always zero, that means f must be a constant. Whatever the initia...

9年以上 前 | 0

回答済み
Modify array zeros detect
You could also use the following method. A is a row vector with 1’s and 0’s, and m is the least number of successive 0’s before...

9年以上 前 | 0

回答済み
Why does this plot not work? Thank's for every help!
It would be better to first solve the equation for y symbolically and then produce a vector of y values: x = linspace(0.5,8...

9年以上 前 | 0

回答済み
Getting decrease in a sine wave as a function of time
The data you show should probably be fitted with something like: a*exp(-b*time)*sin(c*time+d) with the four parameters, ...

9年以上 前 | 1

回答済み
Distances along a plotted line?
The approximate arclength along your curve from (x(i1),y(i1)) to (x(i2),y(i2)) can be computed as the sum of the line segment le...

9年以上 前 | 0

回答済み
How can I choose specific rows in a matrix? (from 1 to 6 than skip 7 to 16 and start taking again from 17th to 22nd)
X = 1:43008; Y = reshape(X,16,[]); Z = Y; Y = Y(1:6,:); Y = Y(:).’; Z = Z(7:16,:); Z = Z(:).’;

9年以上 前 | 0

| 採用済み

回答済み
Dividing every element in a row from a 2x2 matrix by an element from same row from a 2x1 matrix
C = bsxfun(@rdivide,A,B);

9年以上 前 | 2

| 採用済み

回答済み
How can I make these separate for loops into a nested for loop together?
You don’t need for-loops at all. k = zeros(size(A)); k(1:5,6:11) = A(3:7,1:6);

9年以上 前 | 0

回答済み
I want a matrix to be represented in the form of an array
Here are the “Pixel Scan” and “Rearrange” operations: % Let M be the m by n image matrix % Pixel Scan: M = M.'; M(...

9年以上 前 | 0

| 採用済み

回答済み
Split a vector into two vectors randomly
Why not do this: t = original_vec(randperm(Total_Samples)); First_vec = t(1:25); Second_vec = t(26:36);

9年以上 前 | 1

| 採用済み

回答済み
How to plot a piecewise function?
If you only want to plot the function, do this: x1 = linspace(-5,0,50); y1 = 10*ones(1,50); x2 = linspace(0,9,90); y2 =...

9年以上 前 | 0

回答済み
How I can use perms_reps(vec,reps) function with big vectors
For your particular problem, try this: C = nchoosek(1:45,5); n = size(C,1); M = zeros(n,45); % If you get this far...

9年以上 前 | 0

| 採用済み

回答済み
Finding real roots of a cubic equation
This is an equation that can be manipulated so that d is one of the roots of a ninth degree polynomial equation of which only on...

9年以上 前 | 1

回答済み
Array that contains a geometric series
A general form for a geometric series is: [a,a*r,a*r^2,a*r^3,...] You can generate n of these by: s = a*r.^(0:n-1);...

9年以上 前 | 2

| 採用済み

回答済み
Using conditional IF statement
if all(sum(B,2)==1)

9年以上 前 | 0

| 採用済み

回答済み
i need to reshape rows that are in complicated manner!
The number of rows in A must be even. n = size(A,2); B = reshape(A.’,2*n,[]); B = B(ceil((1:2*n)/2)+n*mod(0:2*n-1,2)...

9年以上 前 | 1

| 採用済み

回答済み
Count number of consecutive 1's within a block
Let x be the given row vector. f = find(diff([0,x,0]==1)); p = f(1:2:end-1); % Start indices y = f(2:2:end)-p; %...

9年以上 前 | 10

| 採用済み

回答済み
Non-Sorted nx1 unique values
Let x be the given n by 1 vector. [y,p] = sort(x); d = diff(y)~=0; b = [d;true] & [true;d]; b(p) = b; Then b wi...

9年以上 前 | 2

| 採用済み

回答済み
i want vector which is long size and each time size change but pattren is same in putting value
Let your resulting matrix, M, have m rows and n columns. b = mod(0:n-1,2)==0; M = repmat((1:n).*b+(-1:n-2).*(~b),m,1);...

9年以上 前 | 0

回答済み
How to avoid using 'For loops' while I need to do some operations on the columns of a matrix?
I assume that mu is 1 by d, Sigma is d by d, w is 1 by d, and y is k by 1 where d is the number of elements in the multivariate ...

9年以上 前 | 0

| 採用済み

回答済み
How can I have a warning issued when matlab "rounds" a large number to Inf?
Matlab overflows to infinity (or minus infinity) whenever the result of an operation would round an answer beyond the largest nu...

9年以上 前 | 1

回答済み
lognrnd Function does not work properly at high variance
If you look at the probability density function that corresponds to your particular mu and sigma combination, you will see that ...

9年以上 前 | 0

さらに読み込む