Community Profile # Dyuman Joshi

Last seen: Today Active since 2018

Mechanical Engineer
IITG'20

#### Statistics

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

View by

B&W Image to Excel File with 0 and 1
1) Use imread to read the image. The values in the uint8 (default format) array will be from 0 to 255. 2) Divide the array by 2...

17 jours ago | 0

Can someone help me "Error using sym/diff"
1) Your approach of declaring syms variable and taking x from -pi to pi as initial condition for using dsolve is incorrect . 2)...

17 jours ago | 0

Write program to find maximum number between three numbers?
max([ a b c ])

3 mois ago | 0

Question

How to link code, outputs etc from the MATLAB Live Editor while answering a question on MATLAB Answers? For example -

4 mois ago | 1 answer | 0

### 1

Calling out from for loop
f = @(n)fibonacci(n) f(6) = 8

4 mois ago | 0

| accepted

Find the first element of a column in a matrix that has a value equal to zero
r=find(A(:,n)==0,1) %A is your m by n matrix after executing the code

4 mois ago | 0

| accepted

Indexing Logical Array Intersections
[r, c] = find((row_max&col_min)==1);

4 mois ago | 1

| accepted

Changing Values in a column due to another value
i = find(c==1,1,'first'); %c is the column vector if i>6 c(i-6:i-1)=1; else c(1:i-1)=1; end

4 mois ago | 1

Unrecognized function or variable 'f'
Works fine for me. Make sure your function name is same as the file name.

4 mois ago | 2

Vectors must be the same length.
h=0.04; %step size t=0.04:h:0.6; %time size(t) = 1 15 y=[0.1560 0.0125 0.0850 0.2360 0.2450 0.0...

4 mois ago | 0

Strange "correct" solution to Cody Problem 58. Tic Tac Toe FTW
There are some users who do not attempt to solve a problem, but have instead have found a hack the solver to create a so called ...

4 mois ago | 2

| accepted

how to plot a string vector
plot(Y); xticks(1:12); xticklabels({'januar','februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktob...

4 mois ago | 1

| accepted

Switch Case or if-else?
if-else would be better in this case because you have a range of values of R (a variable). switch is useful when you have descr...

4 mois ago | 2

Plotting the first column of each page on one plot
Change your for loop variable for i=1:size(H_Amputated,3)

4 mois ago | 0

dividing a diagonal matrix into same and different diagonal elements
%This will give the diagonal elements in a separate variable. z = diag(V); %Finding the number of repeated values y = uni...

4 mois ago | 0

Numerical Methods Problem Solution
In MATLAB, indexing start with 1 and not 0 (as it does in some programming languages). %defining the initial values t0 = 1/sq...

4 mois ago | 1

| accepted

grouping data in column vector based on another vector
Assuming that sum(A) == numel(C), You can use for loops and cell arrays to get the result X=C; %Assigning C to another variable...

5 mois ago | 2

All possible combination based on 2^n but with 1 and -1
y=dec2bin([7 4 2 1])-'0'; y(y==0)=-1; z =[y; flipud(y)] This only works for this particular example. If you want a generalise...

5 mois ago | 1

All possible combination based on 2^n
y = flipud(dec2bin(0:2^n-1,n))-'0' %method 1 y = dec2bin(2^n-1:-1:0,n)-'0' %method 2 Choose any of the methods you wi...

5 mois ago | 2

Split vector into array with different ranges
a=[22 9 65 814 165 3]; x=a(a<10); y=a(a>=10&a<100); z=a(a>=100); This is assuming that the numbers in x are in the range [0-...

5 mois ago | 0

Extend a string within a for loop by values from switch case
No, MATLAB doesn't support Augmented addition, (using +=) However, you can obtain the same result with a variable, x=x+1; and u...

5 mois ago | 2

| accepted

Replace nested loops with a matrix
Unew = zeros(nhx, nhy); Unew(2:nhx-1, 2:nhy-1)=U(2:nhx-1, 2:nhy-1)-dt.*(P(3:nhx,2:nhy-1)-P(1:nhx-2,2:nhy-1))./(2*hx); Source

5 mois ago | 0

i try to print from (row, column) but I'm keep getting (row,row) for some reason.
You are getting this result because you have defined tables using horinzontal concatenation. table = [Names,Attempts]; Chang...

5 mois ago | 0

cite the Matlab documentation
Citing MATLAB

5 mois ago | 1

| accepted

syms t a c fun = 3*2^(1/2)*(1 - cos(4*t))^(1/2)*(a^2 + c^2)^(1/2); z = int(fun,t); %gives indefinite integral %result of inte...

5 mois ago | 1

| accepted

Modulo-2 matrix multiplication
size(X) = [1 6]; size(Y) = [3 3]; X and Y are not compatible for multiplcation given their sizes. You can do something like t...

5 mois ago | 1

| accepted

Need help for Cody Problem 42409: Divisible by 7
You are getting the error because your code took to long to process than the allowed time limit. 1 - The input is in the form...

5 mois ago | 3

| accepted

How to return the original polynomial from the calculated roots
So, the coefficients are not the same, but they are similar. %[1 -0.6667 -1.3333] is equal to [3 -2 4]/3. This is because, po...

5 mois ago | 0

Norm and mean of a time series
One of the great features of MATLAB is that the error messages it generates are simple and clear. Norm is an inbuilt function wh...

5 mois ago | 1

| accepted