Solved

Mo money, mo math #2! (★★★)

(adapted from Prob 9 Cody team) You have a matrix for which each row is a person and the columns represent the number of quar...

2 years ago

Solved

Sum of terms in a series 1 (★★★)

Given x and n, compute the following sum: |x|+|x|^(1/2)+|x|^(1/3)+|x|^(1/4)+|x|^(1/5) ... + |x|^(1/n) where ||x|| indica...

2 years ago

Solved

Sum 1 to 100 even number

Write a Matlab program to add all the even numbers from 0 to 100 |

2 years ago

Solved

Times 11

Try out this test problem first. Given the variable x as your input, multiply it by eleven and put the result in y. Exampl...

2 years ago

Solved

Mo money, mo math 1! (★★★)

(adapted from Prob 9 Cody team) You have a vector where the elements represent the number of $20 bills, $10 bills, $5 bills, ...

2 years ago

Solved

Times 3

Try out this test problem first. Given the variable x as your input, multiply it by three and put the result in y. Example...

2 years ago

Answered

How do I calculate the coefficients C in this function while P and T are given?

You can use this equations: T=[4:4:24]'; P=[1e-4;2.5e-4;6e-4;1e-3;1.6e-3;2.25e-3]; plot(T,P,'o') n=length(P); A=[ones(n,1) ...

How do I calculate the coefficients C in this function while P and T are given?

You can use this equations: T=[4:4:24]'; P=[1e-4;2.5e-4;6e-4;1e-3;1.6e-3;2.25e-3]; plot(T,P,'o') n=length(P); A=[ones(n,1) ...

2 years ago | 0

| accepted

Answered

How can I find a variation vector of a parameter ?

N=100; a = 355.5+7; b = 355.5-7; r = (b-a).*rand(N,1) + a; figure plot(r) hold on plot([1 N],[a a],'r') plot([1 N],[b b]...

How can I find a variation vector of a parameter ?

N=100; a = 355.5+7; b = 355.5-7; r = (b-a).*rand(N,1) + a; figure plot(r) hold on plot([1 N],[a a],'r') plot([1 N],[b b]...

2 years ago | 0

Answered

Error in sum of matrixes

try this Nplies = 8; thetadt = [90; -45; 45; 0; 0; 45; -45; 90]; t = 0.125; %SI unit, milimeters h = Nplies*t; % Ply engine...

Error in sum of matrixes

try this Nplies = 8; thetadt = [90; -45; 45; 0; 0; 45; -45; 90]; t = 0.125; %SI unit, milimeters h = Nplies*t; % Ply engine...

2 years ago | 0

Answered

How to rearrange multiple results of a function without using for loop?

Assuming that the initial value of k = 1, then it can be avoided using the repmat command as follows (see vector B), N = 11...

How to rearrange multiple results of a function without using for loop?

Assuming that the initial value of k = 1, then it can be avoided using the repmat command as follows (see vector B), N = 11...

2 years ago | 0

| accepted

Solved

Given a square and a circle, please decide whether the square covers more area.

You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

2 years ago

Solved

Pi Digit Probability

Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

2 years ago

Solved

Convert hex color specification to MATLAB RGB

Here's something that comes up all the time if you deal with web pages. Given a <http://www.w3schools.com/html/html_colors.as...

2 years ago

Answered

How to calculate distance till the next possible stop?

I don't know is correct, parkinglocations = ["Home" "mobile" "ShoppingMall" "mobile" "Workplace" "mobile" "Home"]'; % when "mo...

How to calculate distance till the next possible stop?

I don't know is correct, parkinglocations = ["Home" "mobile" "ShoppingMall" "mobile" "Workplace" "mobile" "Home"]'; % when "mo...

2 years ago | 0

| accepted

Solved

Find out sum and carry of Binary adder

Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition. Examples Previo...

2 years ago

Solved

Bit Reversal

Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

2 years ago

Answered

How to plot (n) circles with known center and radius

I don't know is you want this: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% theta=10 % azimuthal distance between the centers of circl...

How to plot (n) circles with known center and radius

I don't know is you want this: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% theta=10 % azimuthal distance between the centers of circl...

2 years ago | 0

Solved

There are 10 types of people in the world

Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...

3 years ago

Solved

Relative ratio of "1" in binary number

Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...

3 years ago

Answered

¿Cómo puedo encontrar los indices de un arreglo con valores repetidos con la función find y operadores relacionales?

Yo pienso que si te interesan las posiciones de los valores es mejor poner lo siguiente: n=find((A<4)&(A~=0))

¿Cómo puedo encontrar los indices de un arreglo con valores repetidos con la función find y operadores relacionales?

Yo pienso que si te interesan las posiciones de los valores es mejor poner lo siguiente: n=find((A<4)&(A~=0))

3 years ago | 3

Answered

if greater than in for loop

seven=(seven>100).*(seven-25)+(seven<=100).*seven;

if greater than in for loop

seven=(seven>100).*(seven-25)+(seven<=100).*seven;

3 years ago | 0

Answered

Can someone rearrange the code to run

%subdivisions space /time ht=0.01; Tmax=1.2; nx=33; hx=1/(nx-1); x=[0:hx:1]'; %matrices K=stiff2(1/pi^2,hx,nx); M=mass(1/ht,h...

Can someone rearrange the code to run

%subdivisions space /time ht=0.01; Tmax=1.2; nx=33; hx=1/(nx-1); x=[0:hx:1]'; %matrices K=stiff2(1/pi^2,hx,nx); M=mass(1/ht,h...

3 years ago | 0

| accepted

Answered

3d line plot help

Using this function: function Y = Piecewise(X1,X2) T = linspace(-7.5,17,120); N = length(T); for n = 1:N if X1(n) > 0 ...

3d line plot help

Using this function: function Y = Piecewise(X1,X2) T = linspace(-7.5,17,120); N = length(T); for n = 1:N if X1(n) > 0 ...

3 years ago | 0

Answered

How to Rotate the Ellipses at calculated angle?

%cov is 2x2 covariance matrix that is generated through a long process t = 0:0.1:2*pi; %time axis %Xest is center of ellipse a...

How to Rotate the Ellipses at calculated angle?

%cov is 2x2 covariance matrix that is generated through a long process t = 0:0.1:2*pi; %time axis %Xest is center of ellipse a...

3 years ago | 0

Answered

Function returning matrix instead of vector

f=@(xf,xdata)xf(1)*(xf(4)+((xf(2)-xdata)/(xf(3)/2))).^2./(1+((xf(2)-xdata)/(xf(3)/2)).^2)

Function returning matrix instead of vector

f=@(xf,xdata)xf(1)*(xf(4)+((xf(2)-xdata)/(xf(3)/2))).^2./(1+((xf(2)-xdata)/(xf(3)/2)).^2)

3 years ago | 0