# Udit Gupta

Professional Interests: Signal Processing, Eclectro-acoustics, Machine Learning, Music Information Retrieval

**Statistics**

RANK**686**

of 239,118

REPUTATION**79**

CONTRIBUTIONS

**8** Questions

**28** Answers

ANSWER ACCEPTANCE **
87.5%
**

VOTES RECEIVED**16**

RANK**12,714** of 16,800

REPUTATION**15**

AVERAGE RATING**0.00**

CONTRIBUTIONS**2** Files

DOWNLOADS **2**

ALL TIME DOWNLOADS**152**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

Question

'subsindex' error when setting figure position. What is going on?

I am trying to resize a figure as shown H = figure; set(H,'Position',[200 200 800 200]) I get the error Function...

5 years ago | 1 answer | 1

### 1

answerQuestion

Why is there a permission error when repeat writing to excel file?

I am writing results of multiple analyses to different sheets of the same excel file using "writetable" command. The first inst...

5 years ago | 6 answers | 5

### 6

answersText in a figure: Increasing Font Size

You can either include the option 'manual' in your *clabel* call and use your mouse to place the labels; or you can use the 'Lab...

5 years ago | 0

| accepted

Help with data extraction script

Try using the *readtable* function. This imports tabular data into matlab. Alternatively you can use the "Import Data" button...

5 years ago | 0

How to design a bandpass filter

The easiest way is to use the Filter Design and Analysis Tool. Just type |fdatool| in matlab command window. This needs Signal P...

5 years ago | 0

Merging two tables based on time interval

You can use t = interp1(sample_time,tableB.Time,'nearest'); if abs(sample_time-t <= 40/(24*60)) <Update medicat...

5 years ago | 0

how to calculate the probability under a pdf curve and divide it into different sections (areas)?

Assuming you have the curves as a matlab vector, you can use the *trapz* function to find area under it. See http://www.mathw...

5 years ago | 1

weighted average w/ matlab

You can do something like - weight=normpdf(range,centerPoint,spread); wAvg = sum(Y(range).*weight)/sum(weight); In you...

6 years ago | 1

| accepted

Question

Is there a way to convert function handles to nan equivalent function handles?

I am passing a cell array of function handles to my function. Typically a user might pass something like- {@sum,@median,@mea...

6 years ago | 1 answer | 0

### 1

answerHow to find t test of two independent samples in MatLab?

Use the function *ttest2* from matlab statistics toolbox. (http://www.mathworks.com/help/stats/ttest2.html)

6 years ago | 2

| accepted

Anyone know the error checking for special characters

You can use regular expressions. The code will go something like this - if any(regexp(str,'[^_a-zA-Z0-9]+')) <error c...

6 years ago | 0

Save PDF for Latex problems in resolution

I do the following operations before saving my figures for latex set(gcf,'Units','Inches'); pos = get(gcf,'Position'); s...

6 years ago | 0

| accepted

How to do a t-test with repeated measurements from 3 different devices?

You can do it in three steps. H1=ttest(X(1:30),12); H2=ttest(X(31,60),12); H3=ttest(X(61,100),12); If you wa...

6 years ago | 0

Question

How to make the legend selective?

I have a bunch of algorithms I am testing for statistical significance. I wrote a script to generate and save plots which I can ...

6 years ago | 2 answers | 0

### 2

answersQuestion

Wrong color showed by "imagesc" function, what am I doing wrong?

Hi I have a 3x3 matrix of p-values and I want to display it using a colored grid. I am using the "imagesc" function with a "Copp...

6 years ago | 1 answer | 0

### 1

answerPrediction based on previous historical data

You can use mtlabs Curve Fitting tool (cftool). If you don't have that search for any linear regression or linear interpolation ...

6 years ago | 0

Batch process text files

You can use - fileName = [input_directory filelabels(i).name]; That should solve the issue.

6 years ago | 0

| accepted

how to generate random points in a line

For each line (edge) of the polyhedron you can write it's equation as (y - y1) = (y1 - y2)(x - x1)/(x1 - x2) So in case...

6 years ago | 0

| accepted

Question

How to check if a figure is closed using the big red 'X' mark?

Hi! I am using a gui in my application. There are 'Ok' and 'Cancel' buttons there which upon clicking close the figure and do so...

6 years ago | 1 answer | 2

### 1

answerQuestion

Is there a tool/method to determine the versions of Matlab my code is compatible with.

Hi! I sometimes have to distribute Matlab code to my students. I work with a university site license, so I usually have the late...

7 years ago | 1 answer | 0

### 1

answercreating a data array from a matrix

This is simple if you use matlab lower triangle functions. See the example code below please. A = magic(39) % Your Martix ...

7 years ago | 2

Cell contents assignment to a non-cell array object.

Instead of x=input('Dame el valor x0 inicial'); x{1}=x; use temp=input('Dame el valor x0 inicial'); x{1}=temp;

7 years ago | 0

Replacing the column of array elements with NaN.

This should do the trick - |index1 = A(:,1)<x(1,1) | A(:,1)>x(1,2);| |index2 = A(:,1)<x(2,1) | A(:,1)>x(2,2);| |A(index...

7 years ago | 0

where did tstool go?

This is from the documentation "tstool will be removed in a future release. To create a time series object, use timeseries...

7 years ago | 0

| accepted

Extend a vector by extending its elements

If your vector is X. reshape(repmat(X,d,1),1,[]) should do the trick. Example - >> X = [1 2 3 4]; >> d=4; ...

7 years ago | 1

| accepted

arg(Z) is the function returns argument of the complex number Z. but it is showing error while executing arg(1+i) as" Undefined function 'arg' for input arguments of type 'double' ". Can anyone help me?.do u need to convert double to complex?. put u

No such function as arg. Use angle(1+i)

7 years ago | 0

How to ensure a constant amplitude for a sin wave plot ?

I think if you increase the time resolution, that should solve your problem.

7 years ago | 0

| accepted

How to print the first 100 primes including 1 as a vector

To print prime numbers less than 100 use primeNums = [1 primes(100)] See - http://www.mathworks.com/help/matlab/ref/pr...

7 years ago | 0

How to avoid inf

Log of zero is -Inf. To avoid that add a small number before taking the log. For example - D = log(normcdf() - normcdf() ...

7 years ago | 0

| accepted