Answered

How can I do matrix multiplication on sets of data in an array without looping?

I don't know if it would be any more efficient than your loop (you could check with some timing tests) but here is an alternativ...

How can I do matrix multiplication on sets of data in an array without looping?

I don't know if it would be any more efficient than your loop (you could check with some timing tests) but here is an alternativ...

2 månader ago | 0

Answered

plotting fitted curve to a set of data

Here is some example code that shows two typical ways of plotting a data set a long with a fitted curve. % example plotting x,...

plotting fitted curve to a set of data

Here is some example code that shows two typical ways of plotting a data set a long with a fitted curve. % example plotting x,...

2 månader ago | 1

| accepted

Answered

I want to solve the equation within the loop and plot it, but it seems not work

Maybe you can explain further what you mean by it doesn't seem to work. What is it doing that you don't want it to do or what i...

I want to solve the equation within the loop and plot it, but it seems not work

Maybe you can explain further what you mean by it doesn't seem to work. What is it doing that you don't want it to do or what i...

2 månader ago | 0

| accepted

Answered

Issue with "Matrix Dimensions Must Agree"

With the dimensions you indicate, it seems that the denominator will have 12 elements (you say r is 1 x 12) and the denominator ...

Issue with "Matrix Dimensions Must Agree"

With the dimensions you indicate, it seems that the denominator will have 12 elements (you say r is 1 x 12) and the denominator ...

2 månader ago | 0

| accepted

Answered

Find index of a matrix of values into another matrix

This should work assuming you have exactly one match in each row. If some rows have no matches or more than one match you will h...

Find index of a matrix of values into another matrix

This should work assuming you have exactly one match in each row. If some rows have no matches or more than one match you will h...

2 månader ago | 0

Answered

Determining maximum and minimum Daily temperatures

If you have exactly 24 data points for each day (one for every hour) then you could use this approach, assume you have your data...

Determining maximum and minimum Daily temperatures

If you have exactly 24 data points for each day (one for every hour) then you could use this approach, assume you have your data...

2 månader ago | 0

Answered

How to resolve an error for undefined function or variable 'x' within a function?

Without having the actual datafile that the program operates it is difficult to fully debug your code. A cursory inspection indi...

How to resolve an error for undefined function or variable 'x' within a function?

Without having the actual datafile that the program operates it is difficult to fully debug your code. A cursory inspection indi...

2 månader ago | 0

| accepted

Answered

How to make some optimization variables equal to each other?

I assume you are using one of the MATLAB optimization functions such as fmincon or linprog. These functions include arguments Ae...

How to make some optimization variables equal to each other?

I assume you are using one of the MATLAB optimization functions such as fmincon or linprog. These functions include arguments Ae...

2 månader ago | 1

| accepted

Answered

Repeat the concatenation of every n rows

I think this should do what you want: s = reshape(data',178*23,500)' Note the use of the transpose (accent symbol) first to tr...

Repeat the concatenation of every n rows

I think this should do what you want: s = reshape(data',178*23,500)' Note the use of the transpose (accent symbol) first to tr...

2 månader ago | 1

| accepted

Answered

Sum Numbers Excluding Zeros

The following code should do what you want. There may be some way to do this more elegantly, but I think this works and should b...

Sum Numbers Excluding Zeros

The following code should do what you want. There may be some way to do this more elegantly, but I think this works and should b...

2 månader ago | 2

| accepted

Answered

how can I generate a random angle?

Use randn or rand depending upon whether you want the angles to be normally distributed or uniformly distributed. Since randn ...

how can I generate a random angle?

Use randn or rand depending upon whether you want the angles to be normally distributed or uniformly distributed. Since randn ...

2 månader ago | 0

Answered

Matrix addition from multiple files

You haven't provided enough detail to answer your question too specifically but in general the steps would be to read the indivi...

Matrix addition from multiple files

You haven't provided enough detail to answer your question too specifically but in general the steps would be to read the indivi...

2 månader ago | 0

Answered

How to optimize a vector, where only two values are allowed?

If your objective function is linear (I can't tell from what you have included) e.g. minimize over x, f'x where f is row vecto...

How to optimize a vector, where only two values are allowed?

If your objective function is linear (I can't tell from what you have included) e.g. minimize over x, f'x where f is row vecto...

3 månader ago | 1

| accepted

Answered

MATLAB plot not showing.

The problem is that the second plot is replacing (overwriting) the first one in the figure window. If you open up a new figure, ...

MATLAB plot not showing.

The problem is that the second plot is replacing (overwriting) the first one in the figure window. If you open up a new figure, ...

3 månader ago | 0

Answered

How to find the location of the first string matching my searching criteria?

Assuming you can get a cell array B of character vectors containing the headers, and the strings you want to match assigned to s...

How to find the location of the first string matching my searching criteria?

Assuming you can get a cell array B of character vectors containing the headers, and the strings you want to match assigned to s...

3 månader ago | 0

| accepted

Answered

Multiply each column of a matrix by another matrix

If I understand your question correctly then the result of the "operation for each column of E" will be on the main diagonal of ...

Multiply each column of a matrix by another matrix

If I understand your question correctly then the result of the "operation for each column of E" will be on the main diagonal of ...

3 månader ago | 1

Answered

Plotting Root Locus with Pole/Zero Locations

Think about what a root locus plot actually is. It plots the locations of the roots (pole locations) in the complex plane as a f...

Plotting Root Locus with Pole/Zero Locations

Think about what a root locus plot actually is. It plots the locations of the roots (pole locations) in the complex plane as a f...

ungefär ett år ago | 0

| accepted

Answered

Dear Sirs, would you please help me and tell me how can I plot the average value of the previous y, while we have thousands (x, y) versus the current X?

If you do not want to keep all of the y's in memory and are only interested in the average of all of the y's up to the current s...

Dear Sirs, would you please help me and tell me how can I plot the average value of the previous y, while we have thousands (x, y) versus the current X?

If you do not want to keep all of the y's in memory and are only interested in the average of all of the y's up to the current s...

ungefär ett år ago | 0

Answered

How to solve the error?

Look closely at your your assignment statement, Block(l,k)=L0(i:i+b-1,j:j+b-1). The left hand side, Block(l,k) is a scalar value...

How to solve the error?

Look closely at your your assignment statement, Block(l,k)=L0(i:i+b-1,j:j+b-1). The left hand side, Block(l,k) is a scalar value...

ungefär ett år ago | 0

Answered

Delete rows of table through search

I'm not sure from your description exactly what you are trying to do, but I assume it is one of the following two use cases. Use...

Delete rows of table through search

I'm not sure from your description exactly what you are trying to do, but I assume it is one of the following two use cases. Use...

ungefär ett år ago | 0

Answered

Matrix manupulation to get specific index

You can use the MATLAB find function for this. For example: % Define your matrix A = [1 1 1;1 9 1;0 1 0]; % use f...

Matrix manupulation to get specific index

You can use the MATLAB find function for this. For example: % Define your matrix A = [1 1 1;1 9 1;0 1 0]; % use f...

ungefär ett år ago | 0

Answered

"Inputs must be scalars" error message whilst using linspace command

your last line of code should be a =linspace(min(A(:,2)), max(A(:,2)),30); you had a colon separating min(A(:,2)) and m...

"Inputs must be scalars" error message whilst using linspace command

your last line of code should be a =linspace(min(A(:,2)), max(A(:,2)),30); you had a colon separating min(A(:,2)) and m...

ungefär ett år ago | 0

| accepted

Answered

I am plotting a vector(x) as log(x). When I plot I see log of the x values are shown in y axis. But I need original values in y axis. Is thre anyway to do it?. In ansys FRF plots are logs but the y axis will be in meters scale in deformation FRF

I think that semilogy(x,y) does just what you want

I am plotting a vector(x) as log(x). When I plot I see log of the x values are shown in y axis. But I need original values in y axis. Is thre anyway to do it?. In ansys FRF plots are logs but the y axis will be in meters scale in deformation FRF

I think that semilogy(x,y) does just what you want

ungefär ett år ago | 0

Answered

convert vector of n or any size into a matrix

Here's one way to do this. Note that I changed your notation to use n (rather than x) for the number of columns as this seems m...

convert vector of n or any size into a matrix

Here's one way to do this. Note that I changed your notation to use n (rather than x) for the number of columns as this seems m...

mer än ett år ago | 0

| accepted

Answered

Time alignment of two signal with same length

I think the fundamental problem you have with your approach is not that the signals are the same length it is that they contain ...

Time alignment of two signal with same length

I think the fundamental problem you have with your approach is not that the signals are the same length it is that they contain ...

mer än ett år ago | 0

| accepted

Question

How to prevent user from changing directory using uiputfile

I would like to allow a user to select a name for a file to be saved using a standard dialog box for saving files, such as uiput...

mer än 5 år ago | 3 answers | 0

Answered

Calculate vector norm in Simulink?

You can use the dot product block (with the same vector wired to both inputs) followed by a square root. Both are under the Math...

Calculate vector norm in Simulink?

You can use the dot product block (with the same vector wired to both inputs) followed by a square root. Both are under the Math...

ungefär 6 år ago | 2

Answered

How to write cell array into a csv file

You could do it as follows with fprintf c = {'abc' 'def' 'ghk';[23],[24],[67];[87],[13],[999];[656],[6767],[546]}; fi...

How to write cell array into a csv file

You could do it as follows with fprintf c = {'abc' 'def' 'ghk';[23],[24],[67];[87],[13],[999];[656],[6767],[546]}; fi...

ungefär 6 år ago | 3

Question

How can I construct a dataset array from data on an excel worksheet with an unknown number of rows

I would like to construct a dataset array from data on an Excel worksheet. I know the location of the upper left corner of the ...

ungefär 6 år ago | 2 answers | 0