Solved


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

3 years ago

Solved


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

3 years ago

Solved


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

3 years ago

Solved


Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

3 years ago

Question


How to simulate an irradiance of beamlets recombination after emerging from a square aperture, in MATLAB?
I want to simulate (in 3D) the irradiance of several beamlets recombined together after emerging from a square aperture, knowing...

3 years ago | 0 answers | 0

0

answers

Solved


Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

3 years ago

Solved


Calculate Amount of Cake Frosting
Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

3 years ago

Solved


Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

3 years ago

Solved


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

3 years ago

Solved


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

3 years ago

Question


How to find the exact index(row, col) of a maximum value in a matrix?
I want to find the maximum value in an image, I tried to find its index and I found it after converting the image matrix into a ...

3 years ago | 1 answer | 0

1

answer

Question


Cody gives me error for my solution whereas MATLAB run it efficiently
I tried to solve some problem in Cody. I wrote that function and run it in MATLAB and it worked perfectly. While it gives me err...

3 years ago | 0 answers | 0

0

answers

Question


How can I use some downloaded function?
I downloaded some functions files with a script file from Mathworks website. Every time I run this script, it tells me that thes...

3 years ago | 2 answers | 0

2

answers

Solved


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

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

3 years ago

Solved


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

3 years ago

Solved


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

3 years ago

Solved


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

3 years ago

Solved


Return area of square
Side of square=input=a Area=output=b

4 years ago

Solved


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

4 years ago

Solved


Add two numbers
Given a and b, return the sum a+b in c.

4 years ago

Question


Why do we transfer the image into double?
I saw a lot of image processing examples and before conducting any analysis the image is transfered into double. Is it essential...

4 years ago | 2 answers | 0

2

answers

Solved


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

4 years ago

Solved


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

4 years ago

Solved


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

4 years ago

Question


Why sometimes we place an empty brackets inside function inputs?
I don't know the purpose or the mean of these empty square brakets inside many functions, for instance: min( a, [ ],2) imsho...

4 years ago | 1 answer | 0

1

answer

Question


How can I update the x axis limit inside a loop?
% parameters omav = 5*1000*2*pi; % omega average, center sigma = [0,0.5,1,2,5].*1000*2*pi; % std deviation. A.K.A width t...

4 years ago | 1 answer | 0

1

answer

Question


How to make a loop to do a specific operation for multiple variables?
lambda = num(:,1); RefInd1 = num(:,2); RefInd2 = num(:,3); RefInd3 = num(:,4); % For the draw ratio DR=1.00 ny1 = int...

4 years ago | 1 answer | 0

1

answer

Question


Why polar plot is not circular like this?
I tried to plot data by polarplot function and it keeps looking like this.. However, when I plot these data in some other progr...

4 years ago | 0 answers | 0

0

answers

Question


How can I automate Matlab to measure specific regions in an image?
I want to make Matlab to measure these distances (red lines) automatically for every image I insert it. These measured distances...

4 years ago | 1 answer | 0

1

answer

Load more