Solved


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

9 years ago

Solved


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

9 years ago

Solved


Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

9 years ago

Solved


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

9 years ago

Answered
How to create a standalone application of a script that calls "sim" function ?
To create a standalone from a Simulink model, you will need the <mathworks.com/products/simulink-coder/ Simulink Coder>. I don't...

9 years ago | 0

Answered
conversion of daily cell into monthly cell.
Use vertical concatenation. month = [day1; day2; day3; ...; day31]; % day1 through day31 would be the variables containing ...

9 years ago | 0

Answered
Getting error while plotting a 2d countour
In a GUI created in GUIDE, you may have to specify the axes in which to create the contour. contour(handles.axesName, x, y, ...

9 years ago | 0

Solved


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

9 years ago

Solved


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

9 years ago

Solved


Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

9 years ago

Solved


inner product of two vectors
inner product of two vectors

9 years ago

Solved


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

9 years ago

Solved


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

9 years ago

Solved


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

9 years ago

Solved


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

9 years ago

Solved


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

9 years ago

Solved


Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

9 years ago

Solved


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

9 years ago

Solved


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

9 years ago

Solved


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

9 years ago

Solved


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

9 years ago

Answered
Will you show me examples of changing time zones with datetime?
Setting the TimeZone property doesn't change the time of a datetime vector, it just tells Matlab which time zone the datetime ob...

9 years ago | 1

Answered
How to overlay plots one above the other?
Set the 'Clipping' property of what you want outside the axes to off. <https://de.mathworks.com/help/matlab/examples/clipping...

9 years ago | 1

Answered
Invalid Message ID Format. Is my syntax wrong?
You do not need message() for that function. function area = areaof3ang(x1,y1,x2,y2,x3,y3) if nargin~=6 % this is...

9 years ago | 0

| accepted

Answered
How to force output of large figure to not be "scaled", or how to properly print a pdf whose dimensions won't fit on the [small] screen
I haven't exported to PDF, but I used to have similar problems when exporting figures to emf. I have a short script that fixes ...

9 years ago | 0

Solved


Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

9 years ago

Problem


pizza deals
Given two pizza slices of different sizes: * Slice A with angle alpha1, radius r1 and price p1 * Slice B with angle alpha2, ...

9 years ago | 2 | 41 solvers

Answered
How to get 1807 point data array to 1806 data array?
The second input must be a vector, not the size of the output. So if you want to interpolate between the points, use something l...

9 years ago | 0

Answered
can't use the help docements about matlab2015a
It sounds like a currupt Matlab installation. I would suggest you reinstall Matlab and if the problem still persists, call the M...

9 years ago | 0

| accepted

Answered
How do I write a matlab code that requests the user for an array of integers and stores that array into the variable called A. How do I determine whether the integer is odd or even.
doc input Will tell you how to get user input. doc mod could be useful for finding out if a number is odd or even.

9 years ago | 0

Load more