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

meer dan 3 jaar 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]

meer dan 3 jaar 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 = ...

meer dan 3 jaar 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|...

meer dan 3 jaar 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...

meer dan 3 jaar ago | 0 answers | 0

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

bijna 4 jaar 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...

bijna 4 jaar 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...

bijna 4 jaar ago

Solved

Whether the input is vector?

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

bijna 4 jaar ago

Solved

Get the length of a given vector

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

bijna 4 jaar 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 ...

bijna 4 jaar ago | 1 answer | 0

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

bijna 4 jaar ago | 0 answers | 0

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

bijna 4 jaar ago | 2 answers | 0

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

bijna 4 jaar 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....

bijna 4 jaar 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]; ...

bijna 4 jaar 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...

bijna 4 jaar 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...

bijna 4 jaar 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.

bijna 4 jaar 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...

ongeveer 4 jaar ago | 2 answers | 0

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

meer dan 4 jaar 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 ...

meer dan 4 jaar 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:...

meer dan 4 jaar 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...

meer dan 4 jaar ago | 1 answer | 0

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

meer dan 4 jaar ago | 1 answer | 0

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

meer dan 4 jaar ago | 1 answer | 0

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

meer dan 4 jaar ago | 0 answers | 0

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

meer dan 4 jaar ago | 1 answer | 0