Question

How to copy data of one or more variables from one Mat file to another Math file?

I have two Mat files namely 2sn20 and 2sn20Vectorized. They have data of different variables. Some of them are scalars and some ...

4 months ago | 2 answers | 0

Question

How to vectorize this piece of code and why doesn't e come out to be zero though it must come out to be zero because u and b are equal?

u=[30 50 75 -30 -50 -75]; b=u; Noise=5; M = 6;%Constant1 N = 6;%Constant2 d = 0.5;%Constant3 K = length(u)/2; %Cons...

4 months ago | 2 answers | 0

Question

Why this gives error?

I downloaded the attached codes " hPSO1.m", and "hPSOoptions.m" and tried to run it with my fitness function"myfitness.m" (also...

4 months ago | 1 answer | 0

Question

Vector form of for loop?

I have a piece of code that works fine. But it has a for loop as below: M=5; N=10; abc=0.0; for m1=1:M*N abc=abc+(abs(yo(...

4 months ago | 1 answer | 0

Question

All is correct but this code gives error?

I downloaded a file from the Mathworks file exchange and tried to run it, but it was giving error. Then I commented the function...

4 months ago | 1 answer | 0

Question

Why does histogram gives issues? I rephrased my question

I have the following set of data: fitness1=rand(100,1)*1e-7; fitness2=rand(100,1)*1e-5; fitness3=rand(100,1)*1e-3; Each set ...

4 months ago | 2 answers | 0

Question

How to reduce the size of legend in a fig file?

I have a MATLAB figure "abc.fig". The size of the legend is very large and has covered the graphs. I want to reduce its size and...

5 months ago | 1 answer | 0

Question

Can we convert a jpg or png image into a fig file via Matlab?

If we have a *.jpg or *.png image and we want to convert it to *.fig image using MATLAB code, how will we do it?

5 months ago | 1 answer | 0

Question

How to draw CRLB (Cramer Rao Lower Bound) for RMSE vs Noise?

I have the following estimation of RMSE for Noise varying from 10 to 40. How to draw its CRLB graph? RMSE=[0.1252 0.0914 ...

5 months ago | 0 answers | 0

Question

Why this piece of code gives error?

The following piece of code gives error: Positions=rand(30,3); fobj=@fun4sn0; for i=1:size(Positions,1) Fit(i) = fobj(Po...

5 months ago | 1 answer | 0

Question

How to extract coordinate values from a graph in Matlab

I have a graph in a png picture and I want to extract the coordinates from this graph and then I want to draw it by my self in M...

6 months ago | 1 answer | 0

Question

I want arrays of one and two but this code doesn't do it

its deleted

6 months ago | 1 answer | 0

Question

MSE and RMSE of vector and Matrix

I have a vector u=[-30 0 41.721]; and a matrix two=rand(100,3); I want to find the error between the two, square of that error, ...

6 months ago | 1 answer | 0

Question

How to remove the AWGN noise from data?

Let's say we have a vector data Uo=[20 30 40 50]; If we add AWGN noise to it, it becomes data U i.e., U=awgn(Uo,30); Now we s...

6 months ago | 2 answers | 0

Answered

How to code for the following coordinates?

I did it myself. So if any body needs it, here it is: clear all clc N=11;%9;%7; d=0.5; r=zeros(N,3); x=[0 d:d:(N-1)/2*d ze...

How to code for the following coordinates?

I did it myself. So if any body needs it, here it is: clear all clc N=11;%9;%7; d=0.5; r=zeros(N,3); x=[0 d:d:(N-1)/2*d ze...

8 months ago | 0

| accepted

Question

How to code for the following coordinates?

Let N denotes no. of antennas placed along an axis.Now if I have total 7 antennas i.e., N=7 and I place each antenna 0.5 apart o...

8 months ago | 2 answers | 0

Question

How to modify the code to get my desired array?

If we keep 10 antennas at equal distance in a circle on XY-Plane, then their coordinates are given by the code given below: fun...

9 months ago | 1 answer | 0

Question

Why does my function abc give error with optimtool

I have a function file abc. I want to run it with optimtool ga. I do settings in the Optimtool as below: Solver: ga-Genetic Alg...

9 months ago | 1 answer | 0

Question

How to plot like this????????

I want to draw my plot like the one shown in the attachment. I tried but in vain.

9 months ago | 1 answer | 0

Question

How to make size of legend window on a figure window as small as we desire?????

I have drawn my plot having a legend window on it. The legend is coming over the graph lines. I want to make size of the legend ...

9 months ago | 1 answer | 0

Question

Why this piece of code gives error?

CostFunction='fun4sn0'; nPop=120; nVar=4;%nVar=1000; nPop_Initial=nPop; nPop_Final=30; MaxNFE=3e3; MaxIter0=ceil(MaxNFE/...

11 months ago | 2 answers | 0

Question

Why this gives error?

LB=[0 0 0 0]; UB=[10 10 pi pi]; particles_x(1,1)=LB+rand*(UB-LB)

12 months ago | 2 answers | 0

Question

How to draw a pulse train

I want to draw a pulse train in Matlab like the one shown blue in attached picture. The duration of each pulse is Tp and there a...

1 year ago | 1 answer | 0

Question

How to plot peaks on desired location in a 3D plot?

There are two vectors that will make an xy-plane. I want to draw a peak pointing in z-direction on a desired location on the xy-...

1 year ago | 1 answer | 0

Question

How to plot a 3D plot from three linear vectors?

I have three vectors x ,y and z. The size of all of them are same.But all of them are 1D arrays. I want to draw a 3D plot from t...

1 year ago | 1 answer | 0

Question

MATLAB libraries of DHT11 sensor

@ MathWorks MATLAB Hardware Team If the DHT11 sensor is connected to my Arduino and I want to read the temperature and humidi...

1 year ago | 1 answer | 0

Question

Why do upsample and downsample commands give wrong results in start of sequence?

I have a code for upsampling an input sequnce x and then downsampling it back to original by a factor 3. When I look at the plot...

1 year ago | 3 answers | 0

Question

Everything being the same, then why does matrix C give different values in the two codes?

All the values are the same in both the codes, then why does matrix C give different values in both the codes? code1: u=[30 50...

1 year ago | 1 answer | 0

Question

I want to implement these equations in MATLAB but how?

The equations are given in the attachment. Assume lambda=1. How to implement the given equations in MATLAB?

1 year ago | 1 answer | 0