Answered

imbinarize vs im2bw

I believe the reason you are not getting the same is because of the threshold that is chosen for the conversion. im2bw(image) d...

imbinarize vs im2bw

I believe the reason you are not getting the same is because of the threshold that is chosen for the conversion. im2bw(image) d...

environ 22 heures ago | 0

Answered

How to calculate averaged values from 5-min interval values

Using for loops is a very straightforward way that this can be done: x = temps(8928,1); %your data sub1 = ones(8928/12,1); % i...

How to calculate averaged values from 5-min interval values

Using for loops is a very straightforward way that this can be done: x = temps(8928,1); %your data sub1 = ones(8928/12,1); % i...

1 jour ago | 0

| accepted

Answered

Unable to perform assignment because the left and right sides have a different number of elements.

The first problem is that Tr is a vector being assigned to a single value of r1, this is fixed as such: r1(n+1)=r1(n)+h*(K01*(C...

Unable to perform assignment because the left and right sides have a different number of elements.

The first problem is that Tr is a vector being assigned to a single value of r1, this is fixed as such: r1(n+1)=r1(n)+h*(K01*(C...

2 jours ago | 0

Answered

I need help with some graphs

Since you need to plot in 3 dimensions I will be using the surf function. What I would first do is solve all of these equation...

I need help with some graphs

Since you need to plot in 3 dimensions I will be using the surf function. What I would first do is solve all of these equation...

2 jours ago | 1

Answered

Simulink - How to create a conditional "if" block with more than 3 conditions?

**Moved from questions to answer** When you know the matlab code needed to do something in Simulink a Matlab Fuction Block can ...

Simulink - How to create a conditional "if" block with more than 3 conditions?

**Moved from questions to answer** When you know the matlab code needed to do something in Simulink a Matlab Fuction Block can ...

2 jours ago | 0

Answered

How to skip a file in reading a series of csv files using csvread?

One method, though it may be one that is often advised against, is to use a try catch block around the code. When an error occur...

How to skip a file in reading a series of csv files using csvread?

One method, though it may be one that is often advised against, is to use a try catch block around the code. When an error occur...

3 jours ago | 0

| accepted

Answered

How to change the style or fount of a static text on GUIDE

Inside the guide interface you can double click the static text to bring up its properties. Then, you can change the listed font...

How to change the style or fount of a static text on GUIDE

Inside the guide interface you can double click the static text to bring up its properties. Then, you can change the listed font...

4 jours ago | 0

| accepted

Answered

Updating a value inside for loop

A common way people do things like this is with an if statement. For the condition of the if statement you need to relate it to ...

Updating a value inside for loop

A common way people do things like this is with an if statement. For the condition of the if statement you need to relate it to ...

7 jours ago | 1

| accepted

Answered

hi how to solve below eqation in matlab command window in tf command

The tf function expects the num and den to be matrices that hold the coefficients to the numerator and denominator. In your case...

hi how to solve below eqation in matlab command window in tf command

The tf function expects the num and den to be matrices that hold the coefficients to the numerator and denominator. In your case...

8 jours ago | 0

| accepted

Answered

plotting data from data files and saving each plot through out each run of the loop

If you wish to have all the plots on the same figure, you need to use figure; hold on %The rest of your code If you wish to...

plotting data from data files and saving each plot through out each run of the loop

If you wish to have all the plots on the same figure, you need to use figure; hold on %The rest of your code If you wish to...

8 jours ago | 0

| accepted

Answered

Element replacement of matrix.

If using a for loop is not actually a requirement you can do this very simply as such: myMatrix = rand(5,4); % create 5x4 matri...

Element replacement of matrix.

If using a for loop is not actually a requirement you can do this very simply as such: myMatrix = rand(5,4); % create 5x4 matri...

9 jours ago | 0

| accepted

Answered

How to edit plots?

Using your sample code, I do not see what the error is. However I made a few changes to the code that I believe make the output ...

How to edit plots?

Using your sample code, I do not see what the error is. However I made a few changes to the code that I believe make the output ...

9 jours ago | 0

Answered

How to randomize audio files

It looks to me that the line aud_file=strcat('C:\toolbox\aud_file\',audio_files(i).name); is where you get a song. Since the ...

How to randomize audio files

It looks to me that the line aud_file=strcat('C:\toolbox\aud_file\',audio_files(i).name); is where you get a song. Since the ...

10 jours ago | 0

| accepted

Answered

Trajectory animation using coordinate points

I would do it like this: % x1,x2,y1,y2,z1,z2 are your coordinate vectors tstep = .1; % the amount of time between each value i...

Trajectory animation using coordinate points

I would do it like this: % x1,x2,y1,y2,z1,z2 are your coordinate vectors tstep = .1; % the amount of time between each value i...

17 jours ago | 0

Answered

How would you plot a graph which a ball then rolls down (say a y=x^2 graph)

I attached a .m file I created that should work pretty well. It uses a numerical solution by calculating the slope at discrete t...

How would you plot a graph which a ball then rolls down (say a y=x^2 graph)

I attached a .m file I created that should work pretty well. It uses a numerical solution by calculating the slope at discrete t...

24 jours ago | 1

Answered

Sorting a table in Matlab

Yes, you can do it with the sortrows function. Here is an example: A = [1 2 4 5 3 6 5 6]; B = {'a', 'b', 'c', 'e', 'f', 'ba', ...

Sorting a table in Matlab

Yes, you can do it with the sortrows function. Here is an example: A = [1 2 4 5 3 6 5 6]; B = {'a', 'b', 'c', 'e', 'f', 'ba', ...

28 jours ago | 0

| accepted

Answered

So i wanted to add a column to this table.

So one big problem here is that you do not have a table. You have a matrix. And matrices cannot have strings and numbers in them...

So i wanted to add a column to this table.

So one big problem here is that you do not have a table. You have a matrix. And matrices cannot have strings and numbers in them...

30 jours ago | 1

Answered

hey guys im trying to plot this in 3D but i keep getting an error, "Data cannot have more than 2 dimensions."

So the issue is that plot3 takes either a vector or a 2d matrix. Since you are plotting it as points you do not actually need to...

hey guys im trying to plot this in 3D but i keep getting an error, "Data cannot have more than 2 dimensions."

So the issue is that plot3 takes either a vector or a 2d matrix. Since you are plotting it as points you do not actually need to...

environ un mois ago | 2

| accepted

Answered

Index exceeds matrix dimensions

It appears that for some reason fileNameArray is not being populated with values in the line fileNameArray = dir('*.dat'); Ma...

Index exceeds matrix dimensions

It appears that for some reason fileNameArray is not being populated with values in the line fileNameArray = dir('*.dat'); Ma...

environ un mois ago | 0

Answered

How to find specific values in a table, and create an array from rows containing those values?

Here is my go at it. % Create my table so you know what I am testing with. names = {'ssrp' , 'ssrp','tghh'}'; values = [123, ...

How to find specific values in a table, and create an array from rows containing those values?

Here is my go at it. % Create my table so you know what I am testing with. names = {'ssrp' , 'ssrp','tghh'}'; values = [123, ...

environ un mois ago | 0

| accepted

Answered

Index exceeds array bounds error

The problem is a0. In the line hzrd(i,j)=exp(a(i)+b*w(i,j)) ; a needs to be have at least k elements for it to work. You set ...

Index exceeds array bounds error

The problem is a0. In the line hzrd(i,j)=exp(a(i)+b*w(i,j)) ; a needs to be have at least k elements for it to work. You set ...

environ un mois ago | 1

| accepted

Answered

how to store multpile files which has been loaded first in the same script ,in the new variable , through loop

So, I believe this answer could be done using the eval function but since that function is highly discouraged here is my attempt...

how to store multpile files which has been loaded first in the same script ,in the new variable , through loop

So, I believe this answer could be done using the eval function but since that function is highly discouraged here is my attempt...

environ 2 mois ago | 0

Answered

Why are spaces ignored when a character string is scanned?

This is because of the way fscanf reads it in. If you go to the linked documentation and scroll down to Character Fields, it not...

Why are spaces ignored when a character string is scanned?

This is because of the way fscanf reads it in. If you go to the linked documentation and scroll down to Character Fields, it not...

environ 2 mois ago | 0

Answered

How many years to double initial investment with various interest rates

If I understand the equation you posted correctly lets walk through this. S = total amount after n years if P was initially inve...

How many years to double initial investment with various interest rates

If I understand the equation you posted correctly lets walk through this. S = total amount after n years if P was initially inve...

environ 2 mois ago | 0

Answered

Generating a grid around circles in an image

So I felt like making it interactive so I used the built in guide function in matlab to create a GUI. Attached are the two files...

Generating a grid around circles in an image

So I felt like making it interactive so I used the built in guide function in matlab to create a GUI. Attached are the two files...

environ 2 mois ago | 1

| accepted

Answered

What sort of a filter/method can be applied to smoothen sharp peaks on a surface?

In general, if you want to smooth out peaks you want to get rid of the high frequency content, aka a low pass filter. The easies...

What sort of a filter/method can be applied to smoothen sharp peaks on a surface?

In general, if you want to smooth out peaks you want to get rid of the high frequency content, aka a low pass filter. The easies...

environ 2 mois ago | 0

Answered

How to plot for different values of parameters on one run?

Matlab actually has a page on this called Parameterizing Functions. Using one of the options for that I believe this will do i...

How to plot for different values of parameters on one run?

Matlab actually has a page on this called Parameterizing Functions. Using one of the options for that I believe this will do i...

environ 2 mois ago | 0

| accepted

Answered

How to create an animated plot of a temperature data with holding on each year?

Alright lets see how much I can help with. First off to gradient between colors I have a little way down below. I get the rgb ...

How to create an animated plot of a temperature data with holding on each year?

Alright lets see how much I can help with. First off to gradient between colors I have a little way down below. I get the rgb ...

environ 2 mois ago | 1

| accepted

Answered

can someone please help me to find out mistake

Here you go. A few things needed to be changed. First the change that Torsten initially pointed out. Then we further change it t...

can someone please help me to find out mistake

Here you go. A few things needed to be changed. First the change that Torsten initially pointed out. Then we further change it t...

environ 2 mois ago | 0

Answered

storing output of for loop

I believe your goal can be more easily solved using the built in Matlab function reshape. It looks to me like you have a 1x30000...

storing output of for loop

I believe your goal can be more easily solved using the built in Matlab function reshape. It looks to me like you have a 1x30000...

environ 2 mois ago | 0

| accepted