Solved

The 5th Root

Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

nästan 7 år ago

Solved

Tell me the slope

Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

ungefär 7 år ago

Solved

Narcissistic number ?

Inspired by Problem 2056 created by Ted. In recreational number theory, a narcissistic number is a number that is the sum of ...

ungefär 7 år ago

Solved

Parasitic numbers

Test whether the first input x is an n-parasitic number: <http://en.wikipedia.org/wiki/Parasitic_number>. ( _n_ is the second in...

ungefär 7 år ago

Solved

Number of 1s in a binary string

Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

ungefär 7 år ago

Solved

Return the first and last character of a string

Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

ungefär 7 år ago

Solved

Sum of diagonal of a square matrix

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

ungefär 7 år ago

Solved

Make one big string out of two smaller strings

If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

ungefär 7 år 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....

ungefär 7 år ago

Solved

Is this triangle right-angled?

Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

ungefär 7 år ago

Solved

Set the array elements whose value is 13 to 0

Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

ungefär 7 år ago

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

ungefär 7 år 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...

ungefär 7 år ago

Solved

Bullseye Matrix

Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

ungefär 7 år ago

Solved

Back to basics 21 - Matrix replicating

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

ungefär 7 år ago

Answered

Suppose I have a matrix of size(3,3).This is up-scaled by 2 making it (6,6).So there would be a number of vacant values between each element of the initial (3,3) matrix.Then how do you fill up the 0 values in addmatrixR by bicubic/liner interpolation

Just use interp2 on the original matrix, like so: prevR = magic(3) ans = 8 1 6 3 5...

Suppose I have a matrix of size(3,3).This is up-scaled by 2 making it (6,6).So there would be a number of vacant values between each element of the initial (3,3) matrix.Then how do you fill up the 0 values in addmatrixR by bicubic/liner interpolation

Just use interp2 on the original matrix, like so: prevR = magic(3) ans = 8 1 6 3 5...

mer än 7 år ago | 1

Answered

What is the matrix code for column vectors

There are a few ways to do this, for example: x = [u' v (u' + v)] The apostrophe can be used to transpose a matrix. You ...

What is the matrix code for column vectors

There are a few ways to do this, for example: x = [u' v (u' + v)] The apostrophe can be used to transpose a matrix. You ...

mer än 7 år ago | 0

Answered

How can I find a sub-folder in the (just in the) current directory ?

You can specify _exist_ to only look in the current directory. For example: lFolder = 'MyFolder'; if(exist([cd filesep l...

How can I find a sub-folder in the (just in the) current directory ?

You can specify _exist_ to only look in the current directory. For example: lFolder = 'MyFolder'; if(exist([cd filesep l...

mer än 7 år ago | 0

| accepted

Answered

How to convert Matlab figure to excel sheet ?

See this related question: <https://uk.mathworks.com/matlabcentral/answers/100687-how-do-i-extract-data-from-matlab-figures>

How to convert Matlab figure to excel sheet ?

See this related question: <https://uk.mathworks.com/matlabcentral/answers/100687-how-do-i-extract-data-from-matlab-figures>

mer än 7 år ago | 0

Answered

Why function blpsrv is 'undefined' after Datafeed Toolbox is installed

See the product requirements at this <https://uk.mathworks.com/products/availability.html#DF link> It states that Bloomberg d...

Why function blpsrv is 'undefined' after Datafeed Toolbox is installed

See the product requirements at this <https://uk.mathworks.com/products/availability.html#DF link> It states that Bloomberg d...

mer än 7 år ago | 0

Answered

Extract group of identical values from an array

a = [0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1]; nStart = find(diff([0 a 0]) == 1); nEnd = find(diff([0 a 0]) == -1)...

Extract group of identical values from an array

a = [0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1]; nStart = find(diff([0 a 0]) == 1); nEnd = find(diff([0 a 0]) == -1)...

mer än 7 år ago | 0

Answered

Which version of system generator supported by MATLAB 2016a ?

See the following link: <https://www.xilinx.com/support/answers/55830.html AR# 55830> It states that for Vivado System Genera...

Which version of system generator supported by MATLAB 2016a ?

See the following link: <https://www.xilinx.com/support/answers/55830.html AR# 55830> It states that for Vivado System Genera...

mer än 7 år ago | 0

| accepted

Answered

How do I import a timestamp from Excel/csv?

Try this: [NUMERIC, TXT, RAW] = xlsread('My_Spreadsheet_Name'); You'll find the timestamps in both the TXT and RAW outp...

How do I import a timestamp from Excel/csv?

Try this: [NUMERIC, TXT, RAW] = xlsread('My_Spreadsheet_Name'); You'll find the timestamps in both the TXT and RAW outp...

mer än 7 år ago | 1

Answered

which versions are compatible for matlab, intel visual fortran and visual studio

Follow this link: <https://uk.mathworks.com/support/sysreq/previous_releases.html System Requirements & Platform Availability> ...

which versions are compatible for matlab, intel visual fortran and visual studio

Follow this link: <https://uk.mathworks.com/support/sysreq/previous_releases.html System Requirements & Platform Availability> ...

mer än 7 år ago | 0

Answered

how can I extract first number of cell?

a ={[8,21,291,94,455,241,227,36,130] [15,248,455,241,227,36,130] [21,291,94,455,241,227,36,130] [36,130]}; *Question 1:* ...

how can I extract first number of cell?

a ={[8,21,291,94,455,241,227,36,130] [15,248,455,241,227,36,130] [21,291,94,455,241,227,36,130] [36,130]}; *Question 1:* ...

mer än 7 år ago | 2

| accepted

Answered

I have a data set like this, How can i delete raw ofs values less than 10, and T values which are zero, How can i sum s values which are related to same T values ?

One way to do it: data = [878.00 9.00 1.00 12.00 166.00 12.00 ...

I have a data set like this, How can i delete raw ofs values less than 10, and T values which are zero, How can i sum s values which are related to same T values ?

One way to do it: data = [878.00 9.00 1.00 12.00 166.00 12.00 ...

nästan 9 år ago | 0

| accepted

Answered

How can I change tunable parameters in generated C++ class from private to public?

If you set parameter member visibility option to 'public' this will move the tunable parameters structure from private to public...

How can I change tunable parameters in generated C++ class from private to public?

If you set parameter member visibility option to 'public' this will move the tunable parameters structure from private to public...

nästan 9 år ago | 1

| accepted

Answered

I am unable to identify the two simulink blocks that are shown in the snapshot of a Control System Simulink Model.

The first block is the 'Display' block. See <http://mathworks.com/help/simulink/slref/display.html> The second block is the '...

I am unable to identify the two simulink blocks that are shown in the snapshot of a Control System Simulink Model.

The first block is the 'Display' block. See <http://mathworks.com/help/simulink/slref/display.html> The second block is the '...

nästan 9 år ago | 0