Solved

User defined nextpow function

Create a function which will take 2 arguments as n and x, and return y, where, n^y >= abs(x). [ Similar to builtin "nextpow2" fu...

15 hours ago

Solved

how many of the entries are positive?

Given x= sin(linspace(0,10*pi,100)), how many of the entries are positive?

16 hours ago

Solved

poll: would you like the regexp (?@cmd) functionality to be banned in Cody?

This problem is a poll (and a little bit of "white hat hacktivism" as well) regarding Cody users sentiment about the use of rege...

16 hours ago

Solved

Toeplitz Matrix

For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

16 hours ago

Solved

means

Calculate the arithmetic, the geometric and the harmonic mean of a given vector (with positive elements) and return them in a ve...

16 hours ago

Solved

Weighted average

Compute the weighted average Y, of the vector A, given the weight vector W. The weighted average is the sum of the dot produc...

1 day ago

Solved

number of groups

In a classroom, *n* students work on a special project and the other students work in groups of five. If there are 18 students i...

1 day ago

Solved

Electric Flux

Calculate the flux passing through a surface. E is electric field, A is area.

1 day ago

Solved

Convert Angstrom to Meters

Write a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)

1 day ago

Solved

Get the combinations

Consider p,q = 2 vectors of same or different length. Get a Output Array which has all the possible combinations of Elements o...

2 days ago

Solved

Return all matrix elements except elements on diagonal

Consider a given Matrix A=[a b c; d e f; g h i] then return a row vector T such that it contains all the El...

2 days ago

Solved

New Matrix with vector addition on diagonal

consider 2 vectors x=[1 2 3] y=[4 5 6] then generate a new Matrix, where Addition of x & y will be diagonal Elements...

2 days ago

Solved

Help the Patriots get to the Super Bowl

Given a football by the Patriots, return it to them with 2 psi less air in it. (The original psi is passed as a number to the...

2 days ago

Answered

How to store values in a matrix to plot later?

Try this , you should not multiply the infected population to sucesptible population dS_dt = -f*S - S*u - S*v + S*p; ...

How to store values in a matrix to plot later?

Try this , you should not multiply the infected population to sucesptible population dS_dt = -f*S - S*u - S*v + S*p; ...

2 days ago | 0

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

2 days ago

Solved

Find index of non empty cell array

This question aims to understand the characteristics of MATLAB programs. Educational problem. Please find non empty index of ...

2 days ago

Solved

Find the index of elements in a string vector

In the vector of v, find the index of elements specified by a. v = ["Lion","Koara","Elephant","Snake","Dog","Cat","Camel"]; ...

2 days ago

Solved

Implement a bubble sort technique and output the number of swaps required

A bubble sort technique compares adjacent items and swaps them if they are in the wrong order. This is done recursively until al...

2 days ago

Solved

Insert Special character in character cell array.

input={'a','b','c'} then ans={'a','*','b','*','c'}

2 days ago

Solved

Deleting Specific part.

if input is x= { /*[0..10]*/ 0, 11, 21, 31, 41, 55, 50, 10, 810, 9.10, /*[10...25]*/ 100, 110, 120, 130, 140, 255 ...

2 days ago

Solved

Replace Negative(-) by 0 and positive by 1

In a given Matrix Replace all element having *Negative sign with 0* and *Positive elements with 1* .

2 days ago

Solved

Evened up (or not)

You will be provided with an array or matrix that contains various numbers, in addition to an evening variable, e, set to 1 or 0...

2 days ago

Solved

Find out next state (NS) of T Flip-Flop.

Find out next state (NS) of T Flip-Flop based on previous state (PS), inputs. Learn more about T Flip-Flop theory here: <htt...

2 days ago

Solved

Case-insensitive Character Detection

Find the index of a particular character in a string ignoring case. Example Input: x = 'aAbhhfdf' n = 'a' ...

2 days ago

Answered

How to make this plot?

d=DATA{:,1};D=DATA{:,2}; min_year=year(min(d)); max_year=year(max(d)); A=zeros(12,max_year-min_year+1); for k=1:length(d) ...

How to make this plot?

d=DATA{:,1};D=DATA{:,2}; min_year=year(min(d)); max_year=year(max(d)); A=zeros(12,max_year-min_year+1); for k=1:length(d) ...

2 days ago | 1

| accepted

Solved

Find smallest number to leave a remainder of 1

given a vector of numbers, find the smallest number to be divisible by all of them with a remainder of 1. Note: input numbers wi...

2 days ago

Solved

Generate this matrix

Generate the following matrix. n = 2; out = [-4 -3 -2 -1 0 -3 -2 -1 0 1 -...

2 days ago