Beantwortet
Vectorization of a for-loop?
You're matching rows between two matrix. You can do this very efficiently using the intersect function. A dummy example: A = [1...

mehr als 6 Jahre vor | 0

Beantwortet
undefined function 'piecewise' for input arguments of type 'double'.
piecewise defines a symbolic function, so you can't just give a double as input for the anonymous function. If you however expli...

mehr als 6 Jahre vor | 0

Beantwortet
Opposite function of audioread?
Yes, audiowrite

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
how to keep first 3 datas and obtain average, then skip or ignore the next 3 data and keep next 3 datas again....??
An efficient way to do this is to create all the index that are going to belong to the average and then do it in a vectorized wa...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Create a matrix of random numbers with different distributions in each entry
Your code does basically this: A = [1 2 3 ; 4 5 6 ; 7 8 9] Result = A + randn(size(A))*0.1; In your question however you see...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
how to find integration through period of time
You have a constant acceleration, you can simply use the basic equations of motion to calculate the velocity and distance: ...

mehr als 6 Jahre vor | 0

Beantwortet
how to stop a loop at any time during the loop using ui?
A possible solution can be done like this: function gui fig = figure; ButtonHandle = uicontrol('Style', 'PushButton', ... ...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Needed SNR , PSNR, MSE, PSD matlab code for a ECG signal to recognize reconstructed ECG signal
You can use the periodogram function from matab.

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How to write a matlab program to arrange my workspace data?
You could use the function sort to sort your arrays and get the index of the sorting, so you can apply this indexing to u and gi...

mehr als 6 Jahre vor | 0

Beantwortet
heaviside and sign function
The heavside function is not the same as the sign function, you can't simply change one for another. If you want to write the si...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Plotting the set of all unit vectors in different norms efficiently?
Just make a meshgrid and convert it to a vector %X = randn(10000,2); step = 0.02; [Xi,Yi] = meshgrid(-1:step:1,-1:step:1); X...

mehr als 6 Jahre vor | 0

Beantwortet
Combining separate graphs into one and changing the scale to match
You can do the first plot, plot the second one over it and then rescale the y axis to the values of the first plot (since the se...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How we can generate generate a noise signal from gauss distribution ??
the randn function in matlab is a gaussian distribution with variance 1. So you can generate a gaussian with mean x and variance...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How to compare the saved names of two images stored in different folders ?
You have a couple of errors in your code. Firstly to compare strings you must use the strcmp function, so if strcmp(first,last...

mehr als 6 Jahre vor | 1

Beantwortet
How to achieve real-time graphics in MATLAB?
If you plot your ball in matlab and update the plots there it will never be exactly as fast as a real life example because you ...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Multi-target data optimization
Could you explain a little more the problem you're having? In the end it really doesn't matter if your matrix are functions or n...

mehr als 6 Jahre vor | 1

| akzeptiert

Beantwortet
2D color or surface plot based on 3 columns of data
Ideally you should have a perfect grid and them you can do this kind of plot. In your case, however, you have only scattered val...

mehr als 6 Jahre vor | 1

| akzeptiert

Beantwortet
Spectral Substraction for removing noise
Probably your signal is not long enough for you to use 2000 blocks of 350 samples, you can make your loop signal dependent to av...

mehr als 6 Jahre vor | 1

Beantwortet
dot product between system of vectors
How you are getting these values for Q? If you calculate the dot product between the colums of the variables you give the values...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Bisection Method, Newtons method, fixed point, and Globally Convergent Newton's method
From your text I belive you actually want to plot the convergence of the methods. For this you need to save the errors for all i...

mehr als 6 Jahre vor | 0

Beantwortet
why am i getting NaN from my function
As David said your log2(p) is not safe, you can solve this problem by using this line of code: Entropy = - sum(p.*log2(p+eps));...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
connecting 2 object that separately but their location is close ?
You can use the imfill function from the image processing toolbox for such type of problems.

mehr als 6 Jahre vor | 0

Beantwortet
surface plotting with complex function
Maybe you need to add a shading to properly visualize the result? surf(Th,Al,mag) shading interp

mehr als 6 Jahre vor | 0

Beantwortet
Minimisation of object function having 2d array as variables.
Any 2D array can be represented with a vector, which is the normal input to optimization functions, so all you need to do is wri...

mehr als 6 Jahre vor | 0

Beantwortet
How do I implement friction into my script?
Friction is a force that produces acceleration which changes the velocity, so if you add an additional term to the velocity upda...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How to add a new column to several matrices
How you read your files? It should actually be very straight forward, something like this should help (Read it mosty as a pseudo...

mehr als 6 Jahre vor | 0

Beantwortet
Correlated Random variable for shadow fading
exp(-0/d0) equals 1, not 0, so I don't understand why you think the raw exp(-d/d0) would produce those results, since values wil...

mehr als 6 Jahre vor | 1

Beantwortet
Speeding up a for loop
If you don't mind having 3 dimensional arrays something like this can be used rng(42) S1 = 5994; S2 = 88; S3 = 8; A = 100*r...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Rotate vector in row
This may solve your problem: rng(42) n= [1,19,15,18,21,10,16,2,7,3,17,6,1; 1,14,20,8,4,13,9,5,1,0,0,0,0; 1...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How can use parallel programming in the below code?
You can indeed try to do the code in parallel with a parfor loop in the "i" loop and some tweak in the eta2 variable bound like ...

mehr als 6 Jahre vor | 0

Mehr laden