Community Profile # Dyuman Joshi

Last seen: Today Active since 2012

Mechanical Engineer IITG'20

Programming Languages:
MATLAB
Spoken Languages:
English

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

Please how to give different color for each plot for this case
One way is to use rand. Colors here will be choosen randomly x = [-2:0.1:2]; a = [.5, 1, 1.3, 1.95]; figure; for i=1:length(...

11 hours ago | 1

Add and subtract matrix element consecutively
What you are doing in a loop, can be done via element-wise multiplication as well. You can make an array for the corresponding ...

1 day ago | 0

How to determine outside perimeter of an array?
Note - a_perim vector doesn't correspond to the outer elements of a in the example you mentioned. Here's how you can achieve th...

6 days ago | 1

| accepted

How to get variable r recognised when inputting a matrice? eg matrix1 = [1, 0; 2/r, 1]
Use syms to make a symbolic variable (Note - It requires the symbolic math toolbox) syms r matrix1 = [1, 0; 2/r, 1] Or if you...

7 days ago | 1

| accepted

How I can write in code for the Maximum value of 'Y' from left hand side not from right hand side in following figure?
Answering according to the image x=[1 2 3 4 5 6 7 8 9 10 11 12]; y=[3 4 3 2 1 2 3 4 5 6 5 4]; plot(x,y) locmax=islocalmax(y)...

8 days ago | 0

| accepted

I am unable run this code , can i know where is wrong
The way you have defined your function is wrong. See Declare function name, inputs, and outputs function [theta_p, epsilon_max...

9 days ago | 0

Why am I not getting a colorcoded plot?
You are using plot3 to make your graph, in that case, you can not change the color of the points in line individually. Use scat...

9 days ago | 0

Problem with output of fprintf command
You can make it in a single line. (Though 200 glycol feels a bit weird, you might wanna add an unit) input(2) function input(...

10 days ago | 0

How do I plot a function with multiple outputs?
You are calling the function rwABRule incorrectly. Also, there's a spelling mistake in your function call. [VVectA3,VVectB3] ...

11 days ago | 1

| accepted

How to store n iterations of randomly generated matrices
n = 10 ; bounds = [1 100] ; %interval over which the random number generator will produce values randA_all=zeros(3,3,n); for ...

11 days ago | 0

Sorting return by dates
%to get the year of a date [year,~,~] = datevec(727594) %storing the years in y (months and dates are not necessary) %dates a...

12 days ago | 0

How do I concatenate cell arrays and line up the rows according to matching items in a column?
Sort by IDs and then join [~,idhe]=sort(string(high_empathy_ID_factors(:,1))); high_empathy_ID_factors=high_empathy_ID_factors...

13 days ago | 0

Find overlapping days across two datetime variables
%random data dt1=datetime(2022,6,1):datetime(2022,7,27); %1st June to Today dt2=datetime(2022,7,1):datetime(2022,9,1); %1st Ju...

14 days ago | 1

| accepted

How to generate random variable theta for F(theta)=N(1 - (mu*B)/(k*T)*cos(theta)). For N=1 and mu*B/k*T=0.01
syms theta fplot(1-0.01*cosd(theta)) xlim([0 180]) ylim([0.99 1.015])

19 days ago | 1

finding the orthogonal vectors for a series of vectors
Another method will be - for i=1:size(vec,1) v=vec(i,:); %generate a random vector r=rand(1,3); %check it ...

19 days ago | 3

Plotting performance vs inlet temp for jet engine and measuring performance as dh as shown. What am I doing wrong?
The for loop indexing is incorrect close all clear all P1 = 101 ;%pressure in kpa T1 = 298;%temperature in kelvin n = 1.4; ...

20 days ago | 1

To split class in a cell array
Looks like a simple variable assignment %random data y=num2cell(rand(10,30)) class_1 = y(:,1:15) class_2 = y(:,16:30) %if y...

21 days ago | 1

| accepted

Splitting n by 1 matrix
mat2cell approach (gives 1x24 instead of 24x1) A=transpose(1:12552); B=mat2cell(reshape(A,24,[])',ones(1,12552/24)) B{3}'

23 days ago | 0

Question

integral() not working properly?
I am trying to integrate a function, however integral() doesn't seem to give the correct value - f=@(t) sin(t.^3./3); y=integ...

26 days ago | 1 answer | 0

### 1

long integers in matlab
You can use Java. import java.math.* y=BigInteger('10').pow(100) z=BigInteger('10').pow(100).add(BigInteger('1')) sub=z.su...

27 days ago | 0

Changing elements of row after certain element
For a matrix run a loop through the rows x=[-1,-0.65,-0.45,0,0.3,0.8,1,0.4,0.2,-0.1] %Code edited according to the question x...

27 days ago | 1

Conversion to cell from double is not possible.
It looks like you want to store your data in a cell array, with a matrix as an element. Try this %random number n = 4; alpha2...

27 days ago | 0

identify respective ranks of two columns in matrix and match them
You can perform sorting without changing the original data. data = [1 0 0 0.0669378275070259 2 12.1056041717529 2 12.00264...

27 days ago | 1

| accepted

How do I remove elements of an array from another array?
Try this - r1=[];r2=[];%preallocating to find index for k = 1:size(allpoint_i,1) countP = ismember(Pp, allpoint_i(k,:),'...

29 days ago | 0

| accepted

matlab plot for non separable function
syms x y fimplicit(sin(x*y)+y+2==0)

30 days ago | 3

| accepted

Partial Differentiation of a function with exponential is different from other calculators
There's nothing wrong with your answer, it's just simplified version of it. 2 from numerator and denominator is cancelled out an...

1 month ago | 2

| accepted

changing timestamp t and plotting the results.
I am not sure if pause works here on the online/live editor, but it works nicely offline. %building on Torsten's code n=5; dt...

1 month ago | 0

Storing a variable and calling it out again to use and plot
How can you plot with different numbers of x values and y values? x =-0.8:0.8:5; T=ones(1,5); T(1,5)=40; numel(x) numel(T) ...

1 month ago | 0