A résolu


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

environ 6 ans il y a

A résolu


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

environ 6 ans il y a

Réponse apportée
problem to write a condition for 'if'
Try the following code: A = {[1,2,3,4], [1,2,3,6], [1,2,3,8], [1,2,6,7,8], [1,6,8], [2,3,4,7], [3,4,6], [3,4,6,7], [3,4,6,7,8],...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
control system bode plot
Try this: alpha=1;Wcr=10; syms w Mag(w)=piecewise(w<Wcr,20,w>=Wcr,-26.144+20*alpha*log(w)); w=logspace(-1,3,1000); semilogx...

environ 6 ans il y a | 0

| A accepté

A résolu


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

environ 6 ans il y a

A résolu


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

environ 6 ans il y a

A résolu


radius of a spherical planet
You just measured its surface area, that is the input.

environ 6 ans il y a

A résolu


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

environ 6 ans il y a

A résolu


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

environ 6 ans il y a

A résolu


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

environ 6 ans il y a

A résolu


Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

environ 6 ans il y a

A résolu


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

environ 6 ans il y a

A résolu


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"]; ...

environ 6 ans il y a

Réponse apportée
How can I set linewidth directly in bode command?
You can try semilogx. See the following code: sys=tf(4,[1 0.5 4]); [mag,phase,wout] = bode(sys); Mag=20*log10(mag(:));Phase=p...

environ 6 ans il y a | 1

Réponse apportée
How to create a set of impulse values in a given set of timepoints in simulink
See the attached model. I run a simulation for 10 seconds and I create three impulses which appear at t=1, 3 and 6 respectively ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to create initialize block on SIMULINK model corresponding with M-file
You can use Callback Function property of your Simulink model. You can find it in File->Model Properties->Callback Functions. He...

environ 6 ans il y a | 0

Réponse apportée
How can I sample n elements from each column of a matrix?
Following approach can be used(using for loop): n=2; for i=1:size(A,2) y(:,i)=randsample(A(:,i),n); end y

environ 6 ans il y a | 0

Réponse apportée
How to swap columns of a matrix??
Simple approach(Consider matrix A): A(:,[1 2 8 9])=A(:,[8 9 1 2])

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Solving trigonometric equations in MATLAB
Try the following code. It should help you: r1=1;r2=2;r3=3;r4=4;r5=5;%random values x1=100:1:126; syms x2 x3 for i=1:numel(x...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
why matlab always show my equation as matrix dimension
Try this: y = (668.061./x)*[-39-exp(-0.1468*x)]

environ 6 ans il y a | 0

Réponse apportée
Calculating a new variable from a symbolic equation
You already defined values for Q_full and Q. You do not need to define them as symbolic variables later. This will not work. Try...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
finding overlapping and non-overlapping values in matrix
Try the following code: A=[3 16 4 16;3 21 4 21;3 29 3 29;17 27 18 29;25 72 26 72;61 70 61 70;62 63 62 63]; Un=0; for i=1:size...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Matlab function for cumulative power
Try the following code. By changing r and n values, you can see the corresponding results. r=9;n=4; A=zeros(n+1,n+1); for i=1...

environ 6 ans il y a | 2

| A accepté

Réponse apportée
PID controller block in simulink
This PID is in ideal form. In PID block in Simulink, you can set the PID to be in ideal form and enter the parameters. See the a...

environ 6 ans il y a | 0

Réponse apportée
Ho do i convert this number to an integer?
Try vpasolve: w=1150;di=32.59;do=23.44; sol=vpasolve((w-(2.*90.*sind(b))).^2==(w-(90.*sind(b+di))-(90.*sind(b-do))).^2+((90.*c...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
please help me check the error
You forgot to put multiplication operator. Try this: function A=odd_rms(n) A=sqrt(mean((1:2:2*n-1).^2)); end

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to plug in one value a time from a matrix into a function (WaitSecs)
It should look something like this: for k=1:numel(A) WaitSecs(A(k)) end . . .

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How can I resolve this?
Following code solves the problem. The command t(0)==0 does not make any sense since t is independent variable. Also, you used d...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
How to simulate simulink model in a given set of time-points only?
Yes, it is possible. Consider the attached Simulink model which contains a ramp block and its slope parameter is set as 5. Its s...

environ 6 ans il y a | 0

Charger plus