Answered

How to make from different size matrices one size matrices by adding NaN's?

You could do something like this: X = {rand(6,12,4),rand(5,12,4),rand(6,12,4),rand(8,12,4)}; % generate example data for k = 1...

How to make from different size matrices one size matrices by adding NaN's?

You could do something like this: X = {rand(6,12,4),rand(5,12,4),rand(6,12,4),rand(8,12,4)}; % generate example data for k = 1...

3 dagar ago | 0

| accepted

Answered

im new to matlab, does any one know , how to iterate 8 times ?

You could do this with a for loop, something like this h=[.482962913145,.836516303738,.224143868041,-1.2940952251]; numIter = ...

im new to matlab, does any one know , how to iterate 8 times ?

You could do this with a for loop, something like this h=[.482962913145,.836516303738,.224143868041,-1.2940952251]; numIter = ...

4 dagar ago | 1

Answered

Interpolation values from a table

If T.area is a cell array, and maybe T.Mach is also a cell array you must first turn them into ordinary MATLAB vectors, (n by...

Interpolation values from a table

If T.area is a cell array, and maybe T.Mach is also a cell array you must first turn them into ordinary MATLAB vectors, (n by...

8 dagar ago | 0

Answered

Having trouble getting legend to display properly

You could also try putting a common legend on the bottom of the page. Here is an example of how to do that x = 1:100; y = rand...

Having trouble getting legend to display properly

You could also try putting a common legend on the bottom of the page. Here is an example of how to do that x = 1:100; y = rand...

8 dagar ago | 0

Answered

connection Ports of subsystem

It looks like you are using Simscape. I don't have it, so I can't try, but I think you need to convert from a Simulink signal to...

connection Ports of subsystem

It looks like you are using Simscape. I don't have it, so I can't try, but I think you need to convert from a Simulink signal to...

9 dagar ago | 0

Answered

How to fit a general curve on different datasets ?

If I am understanding what you are trying to do correctly, it seems like you should be able to concatenate all of your individua...

How to fit a general curve on different datasets ?

If I am understanding what you are trying to do correctly, it seems like you should be able to concatenate all of your individua...

9 dagar ago | 0

Answered

matrix with vectors: multiplication and generation issue

Yes you could do this with a loop, for example, with just some arbitrary set values for i, a, b, c, d, e, g to illustrate theta...

matrix with vectors: multiplication and generation issue

Yes you could do this with a loop, for example, with just some arbitrary set values for i, a, b, c, d, e, g to illustrate theta...

10 dagar ago | 1

| accepted

Answered

How to Create the following discrete signal (Y[n]) in MATLAB?

You could do something like this x = [-1 0 1 2 3 4 4 4 4 4] n = 1:length(x) y = NaN(1,n(end)) % preallocate providing NaN (No...

How to Create the following discrete signal (Y[n]) in MATLAB?

You could do something like this x = [-1 0 1 2 3 4 4 4 4 4] n = 1:length(x) y = NaN(1,n(end)) % preallocate providing NaN (No...

11 dagar ago | 0

Answered

add new rows to a Matrix

Just as another possibility, this approach is much less general than @Jos but will work for your special case. I didn't look in...

add new rows to a Matrix

Just as another possibility, this approach is much less general than @Jos but will work for your special case. I didn't look in...

21 dagar ago | 0

Answered

How do I get my code to run multiple times? My code looks as follows. My code shows X = 3 when A wins and X = -3 when B wins. I would like to get this code to run multiple times and see how many times A wins out of 10 or so matches.

You don't need a loop for this, just do something like the following N = 10 % number of trials X = rand(N,1) Awins = sum(X<0....

How do I get my code to run multiple times? My code looks as follows. My code shows X = 3 when A wins and X = -3 when B wins. I would like to get this code to run multiple times and see how many times A wins out of 10 or so matches.

You don't need a loop for this, just do something like the following N = 10 % number of trials X = rand(N,1) Awins = sum(X<0....

21 dagar ago | 0

| accepted

Answered

How to divide data into different cells?

Your looping logic looks quite complicated, and it is difficult to follow exactly what your intent is here. From your verbal des...

How to divide data into different cells?

Your looping logic looks quite complicated, and it is difficult to follow exactly what your intent is here. From your verbal des...

23 dagar ago | 0

| accepted

Answered

Faster Alternative to export_fig

Improving somewhat on my earlier comment you could do something like this % provide matrix dimension m = 900; n = 1600; ...

Faster Alternative to export_fig

Improving somewhat on my earlier comment you could do something like this % provide matrix dimension m = 900; n = 1600; ...

23 dagar ago | 0

| accepted

Answered

Problems building a plot

In general the error you are getting is telling you that if you want to plot one variable against another they both have to have...

Problems building a plot

In general the error you are getting is telling you that if you want to plot one variable against another they both have to have...

24 dagar ago | 0

Answered

Index Vector Operation in Matlab

Actually A(b) with the example you have given will return [13 14 2 14 10]. That is the elements are taken from the first column ...

Index Vector Operation in Matlab

Actually A(b) with the example you have given will return [13 14 2 14 10]. That is the elements are taken from the first column ...

25 dagar ago | 0

| accepted

Answered

Polynomial to the power of polynomial.

You should be able to use the MATLAB function fzero for this purpose. You will have call it repeatedly (maybe in a loop) with a ...

Polynomial to the power of polynomial.

You should be able to use the MATLAB function fzero for this purpose. You will have call it repeatedly (maybe in a loop) with a ...

25 dagar ago | 0

Answered

fopen with string vector

Your first problem is that dir returns a structure. If you want the name of, the ith file it returns you should use Name = S(j)...

fopen with string vector

Your first problem is that dir returns a structure. If you want the name of, the ith file it returns you should use Name = S(j)...

25 dagar ago | 0

| accepted

Answered

Using a Subroutine to Create a Plot

I think that what you describe could be implemented with a simple loop. So make a vector of radii that you want to evaluate, set...

Using a Subroutine to Create a Plot

I think that what you describe could be implemented with a simple loop. So make a vector of radii that you want to evaluate, set...

28 dagar ago | 0

| accepted

Answered

nonlinear fit of experimental data

In your example you find a fit to a function of one variable, and are somehow looking for a combination of terms to form that on...

nonlinear fit of experimental data

In your example you find a fit to a function of one variable, and are somehow looking for a combination of terms to form that on...

28 dagar ago | 0

Answered

Using find to check the contents of files within a struct

It looks like your difficulty is coming from the argument that you are providing to the find command. If you look carefully at ...

Using find to check the contents of files within a struct

It looks like your difficulty is coming from the argument that you are providing to the find command. If you look carefully at ...

ungefär en månad ago | 0

| accepted

Answered

Taking middle 4 values of n size array

You could use something like, for an array A n = length(A(:)) % : treats as column even if this is actually a multidimensional ...

Taking middle 4 values of n size array

You could use something like, for an array A n = length(A(:)) % : treats as column even if this is actually a multidimensional ...

ungefär en månad ago | 1

| accepted

Answered

Program for Impulsive Difference Equations

One way to approach this is to transform your difference equation in the single variable y to a system of two difference equatio...

Program for Impulsive Difference Equations

One way to approach this is to transform your difference equation in the single variable y to a system of two difference equatio...

ungefär en månad ago | 1

| accepted

Answered

How should i go about solving a set of ODEs for a set of data points? I would like to automate it as much as possible.

Please see my earlier comments. From the behavior you describe, it looks like Sol1 and SolRequired are returned empty from wha...

How should i go about solving a set of ODEs for a set of data points? I would like to automate it as much as possible.

Please see my earlier comments. From the behavior you describe, it looks like Sol1 and SolRequired are returned empty from wha...

ungefär en månad ago | 0

| accepted

Answered

How should i go about solving a set of ODEs for a set of data points? I would like to automate it as much as possible.

I am not clear on the details of your implementation. It would take some time to go through it all line by line. In case it is ...

How should i go about solving a set of ODEs for a set of data points? I would like to automate it as much as possible.

I am not clear on the details of your implementation. It would take some time to go through it all line by line. In case it is ...

ungefär en månad ago | 1

Answered

How to differentiate elements in a matrix by each other

Say your matrix is called M, you could do something like % find incremental change from one row to the next delta = diff(M); ...

How to differentiate elements in a matrix by each other

Say your matrix is called M, you could do something like % find incremental change from one row to the next delta = diff(M); ...

ungefär en månad ago | 1

| accepted

Answered

How to organize a table?

You could do this with a simple loop I'll assume your table is called mytable % find maximum possible value for cell type cell...

How to organize a table?

You could do this with a simple loop I'll assume your table is called mytable % find maximum possible value for cell type cell...

ungefär en månad ago | 0

| accepted

Answered

concatenating and comparing two datsets

Assuming that the 9th column of both data sets is the same, I think you can do this just with an innerjoin tbl1 = readtable('da...

concatenating and comparing two datsets

Assuming that the 9th column of both data sets is the same, I think you can do this just with an innerjoin tbl1 = readtable('da...

ungefär en månad ago | 1

| accepted

Answered

I want to add a line of best fit to my plot using the polyfit function.

You can do something like this p = polyfit(xL(A),anglex,1); anglexFit = polyval(p,xL(A)); plot(xL(A),anglex,'ko',xL(A),anglex...

I want to add a line of best fit to my plot using the polyfit function.

You can do something like this p = polyfit(xL(A),anglex,1); anglexFit = polyval(p,xL(A)); plot(xL(A),anglex,'ko',xL(A),anglex...

ungefär en månad ago | 0

Answered

open loop response for nonlinear system

Basically you need to define the set of ODE's (ordinary differential equations) that define your system and then solve them. MAT...

open loop response for nonlinear system

Basically you need to define the set of ODE's (ordinary differential equations) that define your system and then solve them. MAT...

ungefär en månad ago | 0

| accepted

Answered

How to implement a frequency dependent analysis?

You are quite close with your code. I think you just need to use the semilogx with a few annotations as shown below %Schirmdämp...

How to implement a frequency dependent analysis?

You are quite close with your code. I think you just need to use the semilogx with a few annotations as shown below %Schirmdämp...

ungefär en månad ago | 0

| accepted

Answered

How do I plot a 3D mesh from multiple csv files?

The problem apparently is with loading the files, nothing to do with plotting 3d mesh, or at least it didn't get far enough to h...

How do I plot a 3D mesh from multiple csv files?

The problem apparently is with loading the files, nothing to do with plotting 3d mesh, or at least it didn't get far enough to h...

ungefär en månad ago | 0

| accepted