Answered

How to send Simulink variable to matlab?

Timeseries signals can be plotted directly: plot(simout) or separated by x and y: plot(simout.Time, simout.Data)

How to send Simulink variable to matlab?

Timeseries signals can be plotted directly: plot(simout) or separated by x and y: plot(simout.Time, simout.Data)

23 días ago | 0

Answered

Why is my plot plotting blank?

Each loop you are plotting one point, only. So you either have to "hold on" the figure to prevent erasing all data before the ne...

Why is my plot plotting blank?

Each loop you are plotting one point, only. So you either have to "hold on" the figure to prevent erasing all data before the ne...

24 días ago | 1

Answered

Replace every nth element in a vector

You must not start your index with '0' but with '1' Inv(1:lifetime:projectlength)= costs;

Replace every nth element in a vector

You must not start your index with '0' but with '1' Inv(1:lifetime:projectlength)= costs;

25 días ago | 0

| accepted

Answered

Start and end point of a signal

Not sure whether I understood your question, but if you want to get the indices of an array for which the data meets certain req...

Start and end point of a signal

Not sure whether I understood your question, but if you want to get the indices of an array for which the data meets certain req...

25 días ago | 0

| accepted

Answered

How can I send the MATLAB data(using loop) to excel???

rndMatrix = zeros(9, 4); % preallocation for i = 1:9 rndMatrix(i, 1) = i; % i rndMatrix(i, ...

How can I send the MATLAB data(using loop) to excel???

rndMatrix = zeros(9, 4); % preallocation for i = 1:9 rndMatrix(i, 1) = i; % i rndMatrix(i, ...

alrededor de 1 mes ago | 0

| accepted

Answered

How to change all the colours in the image to black

Try this: imageData = imread([yourFile]); % split R, G, B imgR = imageData(:, :, 1); imgG = imageData(:, :, 2); imgB = ...

How to change all the colours in the image to black

Try this: imageData = imread([yourFile]); % split R, G, B imgR = imageData(:, :, 1); imgG = imageData(:, :, 2); imgB = ...

alrededor de 1 mes ago | 1

| accepted

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

alrededor de 1 mes ago

Solved

Verify Law of Large Numbers

If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

alrededor de 1 mes ago

Solved

Find the Oldest Person in a Room

Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

alrededor de 1 mes ago

Solved

Convert from Fahrenheit to Celsius

Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

alrededor de 1 mes ago

Solved

Calculate Amount of Cake Frosting

Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

alrededor de 1 mes ago

Solved

Times 2 - START HERE

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

alrededor de 1 mes ago

Answered

How can I determine the time t when a specific value y is reached in SIMULINK?

There are multiple ways of doing this. One is to attach the source block "clock" to a triggered subsystem which contains just a ...

How can I determine the time t when a specific value y is reached in SIMULINK?

There are multiple ways of doing this. One is to attach the source block "clock" to a triggered subsystem which contains just a ...

alrededor de 2 meses ago | 1

| accepted

Answered

Setting a fixed sized matrix size in Simulink at run time

First, add an input 'n' of type „Parameter“ to the Matlab function block using the Simulink ModelExplorer and un-check the “Tuna...

Setting a fixed sized matrix size in Simulink at run time

First, add an input 'n' of type „Parameter“ to the Matlab function block using the Simulink ModelExplorer and un-check the “Tuna...

alrededor de 2 meses ago | 0

| accepted

Answered

Dynamically adding element to an array

priceArray= ... [1 29.21 -1 29.41 -1 29.43 -1 29.63 1 29.01 0 29.21 1 28.62 ...

Dynamically adding element to an array

priceArray= ... [1 29.21 -1 29.41 -1 29.43 -1 29.63 1 29.01 0 29.21 1 28.62 ...

alrededor de 2 meses ago | 1

| accepted

Answered

Approximation of area of an image

Personally, I would try this: 1) Introduce an intensity threshold. All pixels below will be treated as 0, all above as 1. 2) N...

Approximation of area of an image

Personally, I would try this: 1) Introduce an intensity threshold. All pixels below will be treated as 0, all above as 1. 2) N...

alrededor de 2 meses ago | 0

Answered

For loop adding and substracting.

decrA = 0; out = zeros(1, numel(A)); out(1) = A(1); for idx = 2:1:numel(A) if A(idx) == -1 out(idx)...

For loop adding and substracting.

decrA = 0; out = zeros(1, numel(A)); out(1) = A(1); for idx = 2:1:numel(A) if A(idx) == -1 out(idx)...

alrededor de 2 meses ago | 1

| accepted

Answered

How can I control decimal in plot with four axes?

I don't think that it's possible what you want to achieve. A second y axis can be activated with yyaxis or plotyy (same x scali...

How can I control decimal in plot with four axes?

I don't think that it's possible what you want to achieve. A second y axis can be activated with yyaxis or plotyy (same x scali...

alrededor de 2 meses ago | 0

Answered

Plot Graph with different b Values

There is no declaration of 'r'. I guess it should be instead of 'i'? Not sure what exactly you want to plot and/or how 'M' shou...

Plot Graph with different b Values

There is no declaration of 'r'. I guess it should be instead of 'i'? Not sure what exactly you want to plot and/or how 'M' shou...

2 meses ago | 0

Answered

bars with mean and std on them

replace the XEndPoints/YEndPoints by XData(end)/YData(end): xtips1 = b(1).XData(end); ytips1 = b(1).YData(end); Btw, xtickl...

bars with mean and std on them

replace the XEndPoints/YEndPoints by XData(end)/YData(end): xtips1 = b(1).XData(end); ytips1 = b(1).YData(end); Btw, xtickl...

3 meses ago | 0

| accepted

Answered

How can I separate data that does not fit the required format?

Maybe I didn't get your issue, but what about using "contains" and searching for a specific identifier? E.g. contains([your_hex...

How can I separate data that does not fit the required format?

Maybe I didn't get your issue, but what about using "contains" and searching for a specific identifier? E.g. contains([your_hex...

3 meses ago | 0

| accepted

Answered

Index exceeds the number of array elements: in case of for loop.

k4 has 8 members. But the third member of Perm is 8. So plus one leads to 9 which is more than k4 contains k4(Perm(i)+1) = k4(9...

Index exceeds the number of array elements: in case of for loop.

k4 has 8 members. But the third member of Perm is 8. So plus one leads to 9 which is more than k4 contains k4(Perm(i)+1) = k4(9...

3 meses ago | 1

Answered

Making a change in appdesigner when deployed permanent

You have to use "load" / "save" functions to store and reload your settings. The app does not support permanent changes of the ...

Making a change in appdesigner when deployed permanent

You have to use "load" / "save" functions to store and reload your settings. The app does not support permanent changes of the ...

3 meses ago | 0

| accepted

Answered

Concatenate signals ( sine wave and a line )

I guess you want to add a X/Y line after the sine wave, right? In this case you have to concatenate X + t and Y + a in order to...

Concatenate signals ( sine wave and a line )

I guess you want to add a X/Y line after the sine wave, right? In this case you have to concatenate X + t and Y + a in order to...

3 meses ago | 1

Answered

wrong number of rows of cell array using length()-function

You should use the size command to distinguish between row and col. To be more precise: length(X) returns the length of vect...

wrong number of rows of cell array using length()-function

You should use the size command to distinguish between row and col. To be more precise: length(X) returns the length of vect...

3 meses ago | 0

| accepted

Answered

How to select a column on basis of some conditions on the rows?

Does this solve your problem? x = x(:, x(1, :) > 0 & x(2, :) > 0 & x(4, :) < 0)

How to select a column on basis of some conditions on the rows?

Does this solve your problem? x = x(:, x(1, :) > 0 & x(2, :) > 0 & x(4, :) < 0)

3 meses ago | 0

| accepted

Answered

how to do sum of element of multiple number in matlab?

Not sure whether I got your issue. But in case you want to summarize all members of m starting at index 1, up to each member of ...

how to do sum of element of multiple number in matlab?

Not sure whether I got your issue. But in case you want to summarize all members of m starting at index 1, up to each member of ...

3 meses ago | 0

Answered

Cut out all of a square array except for a specified NxN section in the middle.

Try this: rowOffset = (rowdim-m)/2; columnOffset = (columndim-m)/2; centerMatrix = x(rowOffset+1:end-rowOffset,...

Cut out all of a square array except for a specified NxN section in the middle.

Try this: rowOffset = (rowdim-m)/2; columnOffset = (columndim-m)/2; centerMatrix = x(rowOffset+1:end-rowOffset,...

3 meses ago | 1

Answered

load x,y

There are certainly different ways to do so. E.g.: x = 1:1:10; y1=[0.5 1.7 1.75 1.9 2 2.1 2.4 2.6 2.7 2.9 ]; y2=[0.7 1.8 1...

load x,y

There are certainly different ways to do so. E.g.: x = 1:1:10; y1=[0.5 1.7 1.75 1.9 2 2.1 2.4 2.6 2.7 2.9 ]; y2=[0.7 1.8 1...

3 meses ago | 0