Answered

resistors in a circuit

Try this : r3 = 100; % for example Volt_func = @(r)1.24*(r(1)*r(2)+r(2)*r3+r3*r(1))/r(1)/r(2); rout = lsqnonlin(Volt_func,...

resistors in a circuit

Try this : r3 = 100; % for example Volt_func = @(r)1.24*(r(1)*r(2)+r(2)*r3+r3*r(1))/r(1)/r(2); rout = lsqnonlin(Volt_func,...

ongeveer 13 uur ago | 0

Answered

How to implement a formula involving several elements of the same vector?

There are several way to do this, but most basic would be to use 'for' loop to get the feeling of how Matrix indexing works: Pe...

How to implement a formula involving several elements of the same vector?

There are several way to do this, but most basic would be to use 'for' loop to get the feeling of how Matrix indexing works: Pe...

ongeveer 15 uur ago | 1

| accepted

Answered

how to call multiple access file from one folder in matlab

One of the several ways to do this : clear all, close all, clc PathName = 'C:\Users\.......\0 degree\'; % Set the path where f...

how to call multiple access file from one folder in matlab

One of the several ways to do this : clear all, close all, clc PathName = 'C:\Users\.......\0 degree\'; % Set the path where f...

ongeveer 19 uur ago | 0

Answered

Index exceeds matrix dimensions.

P2 is an array of dimesion 1x199 and L=1500. So, when you write : P1=P2(1:L./2+1); that means P1 = P2(1:751); So, indeces of...

Index exceeds matrix dimensions.

P2 is an array of dimesion 1x199 and L=1500. So, when you write : P1=P2(1:L./2+1); that means P1 = P2(1:751); So, indeces of...

ongeveer 19 uur ago | 0

Answered

convert min, hours to 00:00:00 format

Use datestr() to convert number to time x = 15; if x>=60 out = datestr(x/24/60,'HH:MM:SS') else out = datestr(x/24...

convert min, hours to 00:00:00 format

Use datestr() to convert number to time x = 15; if x>=60 out = datestr(x/24/60,'HH:MM:SS') else out = datestr(x/24...

28 dagen ago | 0

Answered

How to solve two differential equations using ode45

Are you sure, e1,e2,c1,c2 are time-variant and not constant ? If they are time-variant then there should be differential terms o...

How to solve two differential equations using ode45

Are you sure, e1,e2,c1,c2 are time-variant and not constant ? If they are time-variant then there should be differential terms o...

ongeveer een maand ago | 0

| accepted

Answered

How do I plot every 10th row of data?

One way to do this efficiently would be to scan the data inside the file at once (instead of doing it one by one in a loop) : ...

How do I plot every 10th row of data?

One way to do this efficiently would be to scan the data inside the file at once (instead of doing it one by one in a loop) : ...

ongeveer 2 maanden ago | 0

| accepted

Answered

how do I insert a custom power curve?

Looks like a "1-D Lookup Table" block in simulink. For more details refer to following link : 1-D Lookup Table

how do I insert a custom power curve?

Looks like a "1-D Lookup Table" block in simulink. For more details refer to following link : 1-D Lookup Table

ongeveer 2 maanden ago | 2

| accepted

Answered

How can I fill an array with varying input dimensions and data type change?

Try this: last_digit_vec = mod(Generator,10); v = {}; for i = 1:length(Generator) v = [v,eval(['mod',num2str(last_digit_...

How can I fill an array with varying input dimensions and data type change?

Try this: last_digit_vec = mod(Generator,10); v = {}; for i = 1:length(Generator) v = [v,eval(['mod',num2str(last_digit_...

ongeveer 2 maanden ago | 1

| accepted

Answered

how to use the row&column indices returned by find to control array element in matrix way

One of the way could be to use absolute indexing of X matrix : ind = find(X==1); ex(ind)=ex(ind)+0.5*(data(ind)-data(ind-je));...

how to use the row&column indices returned by find to control array element in matrix way

One of the way could be to use absolute indexing of X matrix : ind = find(X==1); ex(ind)=ex(ind)+0.5*(data(ind)-data(ind-je));...

ongeveer 2 maanden ago | 0

| accepted

Answered

check inside cell condition

Try this: for i = 1:length(AppleDECB) if ~ischar(AppleDECB{i}) % check if cell doesn't contain char continue; ...

check inside cell condition

Try this: for i = 1:length(AppleDECB) if ~ischar(AppleDECB{i}) % check if cell doesn't contain char continue; ...

ongeveer 2 maanden ago | 0

| accepted

Answered

Average range when value is reached

I assumed that you have test_data in a mat file, for this answer I am assuming the data stored in the variable named 'TestData'....

Average range when value is reached

I assumed that you have test_data in a mat file, for this answer I am assuming the data stored in the variable named 'TestData'....

3 maanden ago | 1

Answered

why does sine curve not properly plotted in simulink

I reckon that you are using variable time step so when you increase your time, time step also increases. So, the curve is not as...

why does sine curve not properly plotted in simulink

I reckon that you are using variable time step so when you increase your time, time step also increases. So, the curve is not as...

3 maanden ago | 0

| accepted

Answered

Finding Values nearest a certain number

If I understand it clearly your P(and d) is a row/column vector of length 4650 and you need to find 11 points which are closest ...

Finding Values nearest a certain number

If I understand it clearly your P(and d) is a row/column vector of length 4650 and you need to find 11 points which are closest ...

3 maanden ago | 0

Answered

How to show the legends of this plot?

You can change the order of plots to assign the legend as required. So, if you want leg1 to show 1st line then you should plot i...

How to show the legends of this plot?

You can change the order of plots to assign the legend as required. So, if you want leg1 to show 1st line then you should plot i...

3 maanden ago | 0

Answered

making a title using editable strings without stacking

In the code you have shown the second to last line as title([get(handles.Title_Input, 'String') get(handles.Y_Label_Input, 'Str...

making a title using editable strings without stacking

In the code you have shown the second to last line as title([get(handles.Title_Input, 'String') get(handles.Y_Label_Input, 'Str...

3 maanden ago | 0

| accepted

Answered

Comparing arrays and calculating

Try this : for i = 1:length(A2) [Alh,im] = sort(A2); w1 = im(find(Alh>A1,1)); % The index for which the v...

Comparing arrays and calculating

Try this : for i = 1:length(A2) [Alh,im] = sort(A2); w1 = im(find(Alh>A1,1)); % The index for which the v...

4 maanden ago | 0

| accepted

Solved

04 - Scalar Equations 1

Define the variable a: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> Use this to calculate x: <<http://samle.dk/STTBD...

5 maanden ago

Solved

Matlab Basics - y as a function of x

Write a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2

5 maanden ago

Solved

Bottles of beer

Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

5 maanden ago

Solved

find radius of cone

if Slant height of Cone(I)& hight of Cone(H) given then find radius of the Cone(R) for example I=5,h=4 then the ans R=3;

5 maanden ago

Solved

Returning a "greater than" vector

Given a vector, v, return a new vector , vNew, containing only values > n. For example: v=[1 2 3 4 5 6] n=3 vNew =...

5 maanden ago

Solved

Arrange vector in ascending order

Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

5 maanden ago

Solved

06 - Matrix Equations 3

Define the matrices _aMat_, _bMat_, and _cMat_: <<http://samle.dk/STTBDP/Assignment1_3a.png>> ( _aMat_ = 9x9 matrix full o...

5 maanden ago

Solved

Permute diagonal and antidiagonal

Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

5 maanden ago

Solved

N-Cards Problem

You have a deck of _N_ cards numbered in order from 1 to _N_. You discard the top card (card 1) and place the next card (card 2)...

5 maanden ago

Solved

Sophie Germain prime

In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

5 maanden ago

Solved

Weighted average

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

5 maanden ago