Risposto

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

circa 5 anni fa | 0

Risposto

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

circa 5 anni fa | 1

| accettato

Risposto

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

circa 5 anni fa | 1

Risposto

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

circa 5 anni fa | 1

Risposto

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

circa 5 anni fa | 1

| accettato

Risposto

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

circa 5 anni fa | 1

Risposto

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

oltre 5 anni fa | 2

| accettato

Risposto

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

oltre 5 anni fa | 0

Risposto

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

oltre 5 anni fa | 0

| accettato

Risposto

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

oltre 5 anni fa | 1

| accettato

Risposto

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

oltre 5 anni fa | 0

Risposto

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

oltre 5 anni fa | 0

Risposto

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

oltre 5 anni fa | 0

Risposto

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

oltre 5 anni fa | 1

| accettato

Risposto

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

oltre 5 anni fa | 0

Risposto

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

oltre 5 anni fa | 0

| accettato

Risposto

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

oltre 5 anni fa | 1

| accettato

Risposto

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

oltre 5 anni fa | 0

Risposto

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

oltre 5 anni fa | 0

| accettato

Risposto

Is it possible to run a function that requires input variables when they are declared later in the function?

It looks to me that the main problem is that you are using the first function wrong. When you define the function function [ar...

Is it possible to run a function that requires input variables when they are declared later in the function?

It looks to me that the main problem is that you are using the first function wrong. When you define the function function [ar...

oltre 5 anni fa | 0

| accettato

Risposto

Log Simulink simulation data to structure element

The way that I would do it is this. In your main simulink model, right click anywhere go to ModelProperties -> Callbacks -> Stop...

Log Simulink simulation data to structure element

The way that I would do it is this. In your main simulink model, right click anywhere go to ModelProperties -> Callbacks -> Stop...

oltre 5 anni fa | 1

| accettato

Risposto

different titles for animation

I would suggest creating the title like this: months = {'Jan', 'Feb', ...}; years = num2str((1979:2018)'); for i = 1:40 ...

different titles for animation

I would suggest creating the title like this: months = {'Jan', 'Feb', ...}; years = num2str((1979:2018)'); for i = 1:40 ...

oltre 5 anni fa | 1

| accettato

Risposto

how to save the index during for loop?

A couple different things can fix this, but I would suggest this one just creating the variable a again after your for loop -> ...

how to save the index during for loop?

A couple different things can fix this, but I would suggest this one just creating the variable a again after your for loop -> ...

oltre 5 anni fa | 0

Risposto

how to solve Index exceeds the number of array elements (1).

What this error is saying is that at some point in that line you are exceeding the number of elements in an array. The (1) is in...

how to solve Index exceeds the number of array elements (1).

What this error is saying is that at some point in that line you are exceeding the number of elements in an array. The (1) is in...

oltre 5 anni fa | 1

| accettato

Risposto

How to display the two biggest blobs in terms of area?

In the line biggestBlob=ismember(labeledImage,indexOfBiggest(1)); you are finding the biggest by looking at the first index i...

How to display the two biggest blobs in terms of area?

In the line biggestBlob=ismember(labeledImage,indexOfBiggest(1)); you are finding the biggest by looking at the first index i...

oltre 5 anni fa | 1

| accettato

Risposto

Changing colors in a stacked bar graph to specific ones?

In order to figure out how that code works I'd suggest first adding a pause(1) before the end of the for loop. This way you can ...

Changing colors in a stacked bar graph to specific ones?

In order to figure out how that code works I'd suggest first adding a pause(1) before the end of the for loop. This way you can ...

oltre 5 anni fa | 0

Risposto

How to convert a continuous figure to discrete?

A couple different ways to do this. When plotting discrete values it is often preferred to use stem instead of plot. It does not...

How to convert a continuous figure to discrete?

A couple different ways to do this. When plotting discrete values it is often preferred to use stem instead of plot. It does not...

oltre 5 anni fa | 0

| accettato

Risposto

Adding columns to tables

Check out https://www.mathworks.com/help/matlab/matlab_prog/add-and-delete-table-variables.html if you have not. It has many wa...

Adding columns to tables

Check out https://www.mathworks.com/help/matlab/matlab_prog/add-and-delete-table-variables.html if you have not. It has many wa...

oltre 5 anni fa | 0

Risposto

Merge up sweep and down sweep together in the same figure to get a chirp up and down

It seems like everything you've done so far is good. To merge two matrices you can use this simple command: chirp = [Tx1 Tx2]; ...

Merge up sweep and down sweep together in the same figure to get a chirp up and down

It seems like everything you've done so far is good. To merge two matrices you can use this simple command: chirp = [Tx1 Tx2]; ...

oltre 5 anni fa | 0

| accettato

Risposto

Controlling a generic engine block

It sounds like you want a very binary controller. If a velocity is larger than a threshold do one thing, if not do another. If t...

Controlling a generic engine block

It sounds like you want a very binary controller. If a velocity is larger than a threshold do one thing, if not do another. If t...

oltre 5 anni fa | 0