Cody

Rohiit Priyadarshan Muralidharan

11789
Rank
2
Badges
160
Score
1 – 27 of 27

Rohiit Priyadarshan Muralidharan submitted a Comment to Problem 44950. Calculate Inner Product

I solved this question with an if condition and the size of my solution was 39. I found the size of the leading solution to be 14. This is the leading solution: function ans = in_prod(x,y) "no"; try x*y; end How is this even correct? I tried to paste the same solution instead of mine and the assertion failed. z is not mentioned anywhere in this code. Can someone enlighten me?

on 30 Mar 2020

Rohiit Priyadarshan Muralidharan submitted a Comment to Problem 44958. Crop an Image

Can someone help me to solve this question? I did not learn image processing. So I tried to solve this question assuming that the pixels either have a value of 1 or 0. I am a beginner. This is my second day into coding. I would really love some help. This is my code: [Ix,Iy]=size(I); for n = 1:Ix %for Rmin if I(n,:)==0 n = n + 1; else n = n; break end end Rmin = n for m = 1:Iy %for Cmin if I(:,m)==0 m = m + 1; else m = m; break end end Cmin = m for o = Rmin:Ix %for Rmax if I(o,Cmin) == 1 o = o+1; elseif I(o,Cmin) == 0 o = o - 1; break; end end Rmax = o for p = Cmin:Iy %for Cmax if I(Rmin,p) == 1 p = p+1; elseif I(Rmin,p) == 0 p = p - 1; break; end end Cmax = p Rpix = Rmax - Rmin + 1 Cpix = Cmax - Cmin + 1

on 29 Mar 2020

Rohiit Priyadarshan Muralidharan received Solver badge for Solution 2180668

on 29 Mar 2020

1 – 27 of 27