# Dyuman Joshi

Mechanical Engineer IITG'20 Time zone - GMT +5.30 (IST)

**Programming Languages:**

Python, MATLAB

**Spoken Languages:**

English, Hindi

**Pronouns:**

He/him

**Professional Interests:**

Fluid Dynamics, Aerospace Engineering, Aerodynamics, Computational Fluid Dynamics (CFD)

**Statistics**

RANK**58**

of 283,706

REPUTATION**2,932**

CONTRIBUTIONS

**10** Questions

**846** Answers

ANSWER ACCEPTANCE **
70.0%
**

VOTES RECEIVED**446**

RANK**9,584** of 19,159

REPUTATION**64**

AVERAGE RATING**5.00**

CONTRIBUTIONS**1** File

DOWNLOADS **19**

ALL TIME DOWNLOADS**509**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

How to find same values in an array and their index

arr = load('array.mat') mat = arr.yintercept val = 1e-6; %As you are dealing with floating point numbers, use tolerance to ...

3 hours ago | 0

How to convert 4D double matrix into 2D arrays

Use squeeze - in = rand(1,1,101,14); size(in) out = squeeze(in); size(out)

3 hours ago | 0

| accepted

Loop inside a loop isn't working

There are 2001 elements in x, not 2000. (Imo) It's better to use numel() to get the number of elements, rather than manually usi...

16 hours ago | 0

| accepted

Help with Pre-allocating function values

Dynamically growing arrays is detrimental to the performance of the code. You should Preallocate arrays according to the final o...

1 day ago | 1

come posso eliminare le colonne di una matrice?

From what I understand - %Random data as input %Here columns 6, 7 and 8 are same as columns 2, 3, and 5 respectively in = [1...

2 days ago | 0

| accepted

Set aspect ratio of stacked plot

You can change the (inner) position of the stacked plot - https://in.mathworks.com/help/matlab/ref/matlab.graphics.chart.stacked...

2 days ago | 0

| accepted

Trying to get a equation in terms of symbolic values but cant

As you are adding Symbolic variables, pre-allocate P as a symbolic array - % vvv P = sym([0; 0; 0;]) syms V3 theta2 theta3...

2 days ago | 0

Create function that varies between 1 and zero if input is 1 or 2

The output variable should be the same - y1 = delt(1) y2 = delt(2) y3 = delt(-69) function y = delt(x) if x == 2 ...

3 days ago | 0

| accepted

plotting same values as individual points on x-axis

x=[1,2,3,4,5,1,2,3,4,5,1,2,3,4,5]; y=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]; vec = 1:numel(y); scatter(vec,y) xticks(vec) xtickl...

4 days ago | 0

| accepted

How to add Mean and Median to a boxplot?

sample=readmatrix('Data.csv'); x=sample(1:end,1); xString=string(x); dataSample=sample(:,2:end); %Calculate mean m = mean...

4 days ago | 0

| accepted

Need to delete the previous points in a plot while plotting continously

Change colors and other properties as you like/prefer. x = [1,2,3,4,5]; y = [3,4,5,6,7]; plot(x, y, 'r') hold on h = anim...

4 days ago | 0

| accepted

MATLABで得られたデータをExcelの各シートに名前を付けて保存したい！

x_data = [1, 2, 3, 4, 5]; y_data = [6, 7, 8, 9, 10]; z_data = [11, 12, 13, 14, 15]; str = ["x" "y" "z"] + "data"; arr = ta...

4 days ago | 0

| accepted

Error: using fmincon FMINCON requires all values returned by functions to be of data type double.

Use matlabFunction to convert the symbolic expression to an anonymous function - %% Input syms d G1 = 3e6; p = 1; G0 = 1e8...

4 days ago | 0

| accepted

linprog ouputting all zeros as solution in optimization problem

linprog finds the minimum of the problem specified. To find the maximum, minimize the negative of the objective funciton - %m...

4 days ago | 0

How to apply the same operation to an ever increasing number of columns?

C = cumsum(A.*B, 2)

4 days ago | 3

| accepted

How to get the coefficients of an equation

How about - syms x1 x2 eq = 2*x1 + x2 <= 0 out = flip(coeffs(lhs(eq)))

5 days ago | 0

| accepted

How to index first element of an arbitary sized matrix?

%Example ind_left = 25; ind_right = 45; vec = ind_left:ind_right; n = 5; A = rand(50*ones(1,n)); % sample n-D input matri...

5 days ago | 0

| accepted

How to center the bars of the histogram over the elements of the input array?

You can either specify the bins accordingly - x = [3 5 1 5 4 1 2 5 3 4]; w = 1; bins = min(x)-w/2:w:max(x)+w/2; histogram(x,...

5 days ago | 1

How to download PDF version of the self-paced courses?

Open the course you want to download content for. There will be a question mark symbol on the top-right side of the screen, nam...

5 days ago | 0

integration using for loop

Use integral2 - f = @(x,y) x.^2 + y.^3; out = integral2(f, 0, 2, 2, 4)

6 days ago | 0

How to create tiledlayout grid in vertical order

Change the Tile-indexing to Column Major, the default is Row Major. tiledlayout(3, 2, 'TileIndexing', 'columnmajor') nexttil...

6 days ago | 2

Compute correlations in 3D arrays

Run a for loop through the 3rd dimension - A_3D = randi(100,374,374,10); B_3D = randi(100,374,374,10); s = size(A_3D,3); [...

6 days ago | 1

| accepted

How to do a loop for different values?

The output images are not big/clear enough with subplot/tiledlayout. So, this code generates a new figure for each image - q ...

7 days ago | 0

| accepted

Any suggestion to replace the diagonal values of matrices in a 3D array?

Replacing diagonal values of each 2D matrix of a 3D matrix with NaN M = randi(100, 4,4,3); %fake input N = eye(size(M,[1 2]));...

7 days ago | 1

| accepted

What is the for loop that I can use to do the following then save the results as .mat file?

Preallocate arrays according to the final size and the data type and modify the arrays iteratively. Use indexing to obtain the ...

7 days ago | 0

| accepted

Filtering a large vector by two separate vectors with ranges

Start = [1; 10; 20]; End = [5; 17; 25]; n = numel(Start); C = cell(1,n); for k=1:n C{1,k} = Start(k):End(k); end...

7 days ago | 1

| accepted

How to code MATLAB to call names using strcat

"Even though I typed such a code, at first it gets stuck in my path, where is the problem?" Probably because you have not added...

8 days ago | 0

Issues with reading/using "*" and "#" in a string

> You only used i-th term for the first comparison only, rest of the comparisons are with vector. if inputNum(i) >= 0 & inputNu...

9 days ago | 0

| accepted