Answered
Extract variable in nested for loop that otherwise gets replaced
1.- the product HCPV(i)=p(i)*h(i) need not be in a for loop. If you define p and h same size, in MATLAB you simply...

9 years ago | 0

| accepted

Answered
TRAINING must be a numeric matrix.
hi Hazel read the help for command *training* c = cvpartition(10,'kfold',3) c = K-fold cross validation partition...

9 years ago | 0

Answered
how to find prime numbers by using mod function
Mohame primes_list=[] for k=1:1:200 L=mod(k,[1:200]); L2=find(L==0); if length(L2)<3 prime...

9 years ago | 2

Answered
Determining which came first, Min or Max and then subtracting
do you mean this? data1=randi([-10 10],1,10) [max_data1 max_index]=max(data1);[min_data1 min_index]=min(data1); i...

9 years ago | 0

Answered
Sum in a loop
Hi Miguel with no further information the following does what you ask for U=randi([-10 10],1,10) = 7.00 9.00 ...

9 years ago | 0

| accepted

Answered
For what kind of norm is this code?
Fred Following common norms 1. Euclidean norm: the length of a 1D vector, understanding by length the distance to t...

9 years ago | 2

| accepted

Answered
Code for Plotting Sphere function
Atinesh, 4 steps 1. define the [x y] grid: x=[-10:1:10];y=[-10:1:10]; 2. build all possible points, there are othe...

9 years ago | 5

| accepted

Answered
How can I change multiple variable name within a loop, while assigning those variables as matrix values?
the initial extraction does not need a for loop: Cyc_n=dataMat(:,1); Cyc_p=dataMat(:,2); Cyc_v=dataMat(:,3); S...

9 years ago | 0

Answered
Shifting number to end of an array
When you say 'to the end' of the array, what happens to the values shifted beyond the size of the array, do they show up at the ...

9 years ago | 0

Answered
Where is the problem in this if-else structure?
because in your if cond1 elseif cond2 end cond1 and cond2 are nested, cond2 only happens if cond1 is f...

9 years ago | 0

Answered
How do I find the closest points in a matrix
Hi Abdul please check if the following answers your question function void A=[1 2 4 5 100; 2 3 4 5 1; ...

9 years ago | 0

Answered
convolution of two functions
Richard You don't really need the Symbolic toolbox. MATLAB already have classes to define standard and custom probability fu...

9 years ago | 9

Answered
wavelet based contourlet transform
Nadia try the following 1. install this contourlet toolbox, by Minh Do and Martin Vetterli <http://uk.mathworks.com/...

9 years ago | 6

| accepted

Answered
String elements of a cell as a name to the array elements of another cell
Debjyoti Use the command evalin. evalin executes whatever you input, as long it's valid syntax. For instance, let's say...

9 years ago | 0

Answered
How to convert 2D image of circle shape to 2D straight line ?
Ole the following script answers your question, attached script and the image of your question with name used in the script. ...

9 years ago | 3

| accepted

Answered
class and structure in matlab
a good start are the pages for commands class <http://uk.mathworks.com/help/matlab/ref/class.html?searchHighlight=class> ...

9 years ago | 2

| accepted

Answered
How to plot the correct axes for a heatmap
Yeping the range in imshow( , ,[range]) does not change the axis ticking. For such purpose, to change the X axis ticks to ...

9 years ago | 2

| accepted

Answered
How to correct the below code?
Satish change your last line from y=X*beta0*(eye(n))'+e; to diag(X*beta0)+e I assumed r=1 the comma...

9 years ago | 0

| accepted

Answered
How can I resample the acceleration signal?
Hi Bijay I passed your image through the OCR and obtained the attached text file data2.txt there may be a few differing numb...

9 years ago | 1

| accepted

Answered
Problem with optimization using fminunc
If you remove the 'LinesearchType' option, the error disappears, just a warning options=optimset('Display','notify','M...

9 years ago | 1

| accepted

Answered
function arcsin in matlab
No, all input complex numbers seem to give complex angles, from the following the only way to get a real angle is to input a rea...

9 years ago | 1

Answered
function arcsin in matlab
the answer to your question, how to calculate asin() for any input, and understand the output you need to know how to split the ...

9 years ago | 0

Answered
How to solve equation with for loop? If it's not possible to, is there any alternative options?
Meilin you may want to solve for complex variable. Before solving, why not having a look how the function looks like: f...

9 years ago | 0

| accepted

Answered
how to do zero padding for a vector?
Grupeet the padding you may have in mind is the actual interpolation of zeros blocks after each symbol. A=[1 2 3] ...

9 years ago | 42

Answered
how do i implement y=nx(n-6) in matlab
Abhishek to 'shift' in time, linearly, it is, to delay or advance in time n, you don't multiply. To obtain the time base, ...

9 years ago | 1

| accepted

Answered
S parameters calculating errors
Hi Xining I have just started using the Antenna Toolbox for MSc, but it looks like the standard dipole and monopole elements ...

9 years ago | 1

| accepted

Answered
How to solve a system of equations in the matlab?
when det(A)=0, cond(A) is >>1 A=[0 1 -1 0;1 -1 0 0;-1 0 0 1;0 0 1 -1];b=[-40;160;-330;210] det(A) then instead of A...

9 years ago | 0

| accepted

Answered
How to print figure generated by GUI?
try the following printdlg you should see an empty figure frame, and after that your system should show the printe...

9 years ago | 1

Answered
Interp3 variables with monotonic increasing values
Let me split your data first, to avoid mixing different variables A=[0 0.1 -2 0.55 0 0.1 0 0.5 0 0.1 2 0.55 0 1 -2...

9 years ago | 0

| accepted

Load more