Community Profile

photo

Shubham Gupta


Last seen: 1 day ago
301 total contributions since 2017

Shubham Gupta's Badges

  • Cody Challenge Master
  • 3 Month Streak
  • Knowledgeable Level 3
  • CUP Challenge Master
  • First Answer
  • Thankful Level 1
  • Magic Numbers II Master
  • Sequences And Series I Master
  • Cody5 Easy Master
  • Solver

View details...

Contributions in
View by

Solved


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

1 day ago

Solved


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

1 day ago

Solved


Find the palindrome
Given the string a, find the longest palindromic sub-string b. So when a = 'xkayakyy'; you should return b = 'kayak';

3 days ago

Solved


DNA N-Gram Distribution
Given a string s and a number n, find the most frequently occurring n-gram in the string, where the n-grams can begin at any poi...

3 days ago

Solved


Mandelbrot Numbers
The <http://en.wikipedia.org/wiki/Mandelbrot_set Mandelbrot Set> is built around a simple iterative equation. z(1) = c z...

3 days ago

Solved


Remove the small words from a list of words.
Your job is to tidy up a list of words that appear in a string. The words are separated by one or more spaces. Remove all words ...

3 days ago

Solved


Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...

3 days ago

Solved


Longest Divisor Run
Given the vector a, find the longest run of consecutive numbers that can be evenly divided by the same number d where d > 1. ...

3 days ago

Solved


Remove the polynomials that have positive real elements of their roots.
The characteristic equation for a dynamic system is a polynomial whose roots indicate its behavior. If any of the <http://www.ma...

3 days ago

Solved


Renaming a field in a structure array
MATLAB has a <http://www.mathworks.com/help/techdoc/ref/setfield.html setfield> and a <http://www.mathworks.com/help/techdoc/ref...

3 days ago

Solved


Get the area codes from a list of phone numbers
Given a string of text with phone numbers in it, return a unique'd cell array of strings that are the area codes. s = '508-6...

3 days ago

Solved


It dseon't mettar waht oedrr the lrettes in a wrod are.
An internet meme from 2003 (read more <http://www.snopes.com/language/apocryph/cambridge.asp here>) asserted that readers are re...

3 days ago

Solved


Find state names that start with the letter N
Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...

4 days ago

Solved


Connect Four Win Checker
<http://en.wikipedia.org/wiki/Connect_Four Connect Four> is a game where you try to get four pieces in a row. For this problem, ...

4 days ago

Solved


Calculate the Levenshtein distance between two strings
This problem description is lifted from <http://en.wikipedia.org/wiki/Levenshtein_distance>. The Levenshtein distance betwee...

7 days ago

Solved


Given two strings, find the maximum overlap
Given two strings s1 and s2, create a new string s3 which is as short as possible and contains both strings. If s1 = [1 2...

7 days ago

Solved


Counting in Finnish
Sort a vector of single digit whole numbers alphabetically by their name, in Finnish. See the Wikipedia page for <http://en.wik...

15 days ago

Question


Function browser is empty
In MATLAB command window, one should be able to access Function Browser to quickly see the syntax for a particular function. To ...

4 months ago | 0 answers | 0

0

answers

Answered
Datenum with a.m. and p.m.
Assuming there is ".m. EST" attached to each "timestamp" at the end. You can follow the steps: Step-1 Replace ".m. EST" to just...

1 year ago | 1

| accepted

Answered
Trying to count number of cells between two columns
In the code that you have shared whichDistance is an empty matrix. So when you do raw(whichDistance, :)=[]; raw array doesn't ...

1 year ago | 0

Answered
index array to access the value in matrix
Step1 - Convert the subscript to indeces using x & y(Hint: sub2ind) Step2 - Calculate values of IM for calculated indeces Step...

1 year ago | 0

| accepted

Answered
Writing a Function Code
Try: function out = timeconv(t) y = datestr(round(t/900)*900/(24*60*60),'HH:MM AM'); end

1 year ago | 0

Answered
How to find the maximum value for each 24 rows in an array?
According to the comments, you have provided, this will produce the desired output : yd = max(max(mn2t)); % first find maximum ...

1 year ago | 1

| accepted

Answered
how to index a cell array?
Try : area_r = arrayfun(@(a) cellfun(@(c) trapz(c(c>=0)),a.elevation,'UniformOutput',false), K, 'UniformOutput',false); I hope...

1 year ago | 0

| accepted

Answered
Getting an empty plot
Try: clear; x = linspace(5.62,31.62); p = -10*log10((1+ (31.5844 * (x.^2)) + (11.24*x*cos(pi)))./ (32.5844*(1 + (x.^2)))); % ...

1 year ago | 0

| accepted

Answered
Legend in a "for loop"
Try : for ii=1:length(giri) figure(3); plot(m(indice_m_0:loc(ii)),psic_pos(ii,indice_m_0:loc(ii)),'DisplayName',['ii = ',num2...

1 year ago | 1

Answered
How can i return a value based on mutliple fields?
Try: id = find(N2.Components(:,1) == 290 & N2.Components(:,2) == 296); PowerConsequences_out = N2.PowerConsequences(id); ICTC...

1 year ago | 0

| accepted

Answered
Sub function error within main function
Try: function volSAtsa(l , w, h) vol = volume (l, w, h); [a1, a2, a3] = sides(l, w , h); tsa = total(a1 , a2 , a3); out(vol...

1 year ago | 0

Answered
How can I make the numbers count horizontal instead of vertical?
Try a = input('What is the size of the square array? (Enter one number): ','s'); sq = str2num(a); elements = 0; for x = 1:sq...

1 year ago | 0

| accepted

Answered
Plotting daily mean values of temperature
Assuming there are no leap years in this period of time, I think you have a vector of dimesion (35040x1) (2samples*24hrs*365days...

1 year ago | 0

Load more