Community Profile

photo

Dyuman Joshi


Last seen: Today Active since 2018

Mechanical Engineer
IITG'20

Statistics

All
  • Treasure Hunt Participant
  • MATLAB Central Treasure Hunt Finisher
  • 3 Month Streak
  • Revival Level 1
  • Matrix Patterns II Master
  • Sequences And Series III Master
  • Personal Best Downloads Level 1
  • Explorer
  • Computational Geometry I Master
  • Knowledgeable Level 2
  • First Submission
  • First Review

View badges

Content Feed

Answered
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...

11 days ago | 0

Answered
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)...

11 days ago | 0

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

3 months ago | 0

Question


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

4 months ago | 1 answer | 0

1

answer

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

4 months ago | 0

| accepted

Answered
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 months ago | 0

| accepted

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

4 months ago | 1

| accepted

Answered
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 months ago | 1

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

4 months ago | 2

Answered
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 months ago | 0

Answered
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 months ago | 2

| accepted

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

4 months ago | 1

| accepted

Answered
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 months ago | 2

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

4 months ago | 0

Answered
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 months ago | 0

Answered
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 months ago | 1

| accepted

Answered
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...

4 months ago | 2

Answered
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...

4 months ago | 1

Answered
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...

4 months ago | 2

Answered
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-...

4 months ago | 0

Answered
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...

4 months ago | 2

| accepted

Answered
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

4 months ago | 0

Answered
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 months ago | 0

Answered
cite the Matlab documentation
Citing MATLAB

5 months ago | 1

| accepted

Answered
I could not integrate using MatLab, Can you please help me?
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 months ago | 1

| accepted

Answered
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 months ago | 1

| accepted

Answered
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 months ago | 3

| accepted

Answered
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 months ago | 0

Answered
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 months ago | 1

| accepted

Answered
Question about Indexing a function
B = A(A<0) means to allocate all the elements of A which are less than zero to B. In case you want to use if statement to obtai...

5 months ago | 2

| accepted

Load more