Answered

Arrays are Empty? WHY?

My Question, when I run the code my arrays are not being filled in the for loop. More to the point, when you run the code you g...

Arrays are Empty? WHY?

My Question, when I run the code my arrays are not being filled in the for loop. More to the point, when you run the code you g...

etwa 12 Stunden ago | 0

Answered

Write 3x1 matrix to excel file in for loop. How do I write with a for loop in every 3rd cell

One way: LaminaSress = zeros(3, NumLayers); %assuming that the result of your equation is a 3 elements vector for layer = 1:Nu...

Write 3x1 matrix to excel file in for loop. How do I write with a for loop in every 3rd cell

One way: LaminaSress = zeros(3, NumLayers); %assuming that the result of your equation is a 3 elements vector for layer = 1:Nu...

etwa 12 Stunden ago | 0

| accepted

Answered

How can i use roots function with a 100x3 matrix

result = cellfun(@roots, num2cell(yourmatrix, 2), 'UniformOutput', false) Will return a nx1 cell array of column vectors which ...

How can i use roots function with a 100x3 matrix

result = cellfun(@roots, num2cell(yourmatrix, 2), 'UniformOutput', false) Will return a nx1 cell array of column vectors which ...

etwa 13 Stunden ago | 0

| accepted

Answered

Error using vertcat Dimensions of arrays being concatenated are not consistent.

"How can i make sure that 4 datas read from serial port ?" Specify the number of elements to read as the 3rd argument of fscanf...

Error using vertcat Dimensions of arrays being concatenated are not consistent.

"How can i make sure that 4 datas read from serial port ?" Specify the number of elements to read as the 3rd argument of fscanf...

etwa 13 Stunden ago | 0

Answered

Table and Array Indexing using loops

The aim is to increase the sample size of my data by sampling the data at 24 hours intervals. why didn't you say that in the fi...

Table and Array Indexing using loops

The aim is to increase the sample size of my data by sampling the data at 24 hours intervals. why didn't you say that in the fi...

etwa 23 Stunden ago | 0

Answered

Output argument <Variable> (and maybe others) not assigned during call to <Function>.

The cv variable is only created iff nargout is 2. With 3 outputs, indeed cv will not exist. Change if nargout == 2 to if nar...

Output argument <Variable> (and maybe others) not assigned during call to <Function>.

The cv variable is only created iff nargout is 2. With 3 outputs, indeed cv will not exist. Change if nargout == 2 to if nar...

ein Tag ago | 0

| accepted

Answered

Hi, I am modeling blood flow, and first I need to create structural rectangular mesh of points, so in the next step I could find the value of pressure, velocity etc. in every each point. Do you please know, how to create this mesh? Thank you

Your description is not clear, and there's no point giving us code that doesn't work. It sounds like you're looking for meshgri...

Hi, I am modeling blood flow, and first I need to create structural rectangular mesh of points, so in the next step I could find the value of pressure, velocity etc. in every each point. Do you please know, how to create this mesh? Thank you

Your description is not clear, and there's no point giving us code that doesn't work. It sounds like you're looking for meshgri...

2 Tage ago | 0

| accepted

Answered

Need help with deleting rows in my table

Why are you reading the data as arrays, converting to table, then converting back to array. Choose one type and stick to it rath...

Need help with deleting rows in my table

Why are you reading the data as arrays, converting to table, then converting back to array. Choose one type and stick to it rath...

3 Tage ago | 1

| accepted

Answered

create a function that takes a vector as an input parameter and returns another vector where each component is the initial vector repeated n times.

"Output argument "B" (and maybe others) not assigned during call to "cyclic_shift_recursion" Well, yes matlab is correct. Your ...

create a function that takes a vector as an input parameter and returns another vector where each component is the initial vector repeated n times.

"Output argument "B" (and maybe others) not assigned during call to "cyclic_shift_recursion" Well, yes matlab is correct. Your ...

4 Tage ago | 1

| accepted

Answered

Just how random are random numbers in MATLAB?

"Every single time so far there has been a number 19,950+ within 10 generations or sometimes far less." You will have to expla...

Just how random are random numbers in MATLAB?

"Every single time so far there has been a number 19,950+ within 10 generations or sometimes far less." You will have to expla...

4 Tage ago | 1

Answered

Add cell value from a matrix row based on corresponding index to another matrix row

If you want to keep using numeric matrices: [~, whereinA] = ismember(B(:, [2 4 6]), A(:, 1)) C = reshape([reshape(B.', 2, []);...

Add cell value from a matrix row based on corresponding index to another matrix row

If you want to keep using numeric matrices: [~, whereinA] = ismember(B(:, [2 4 6]), A(:, 1)) C = reshape([reshape(B.', 2, []);...

4 Tage ago | 1

| accepted

Answered

How to convert a char into datetime variable?

datetime('11:04:55') Note that it will use the current date for the date part (since a datetime is always date + time as the na...

How to convert a char into datetime variable?

datetime('11:04:55') Note that it will use the current date for the date part (since a datetime is always date + time as the na...

4 Tage ago | 1

| accepted

Answered

How to initialize object array with different parameters?

With the current interface, this is probably the best you can do: dim = [3,2]; param = 1:6; param = num2cell(param); %each...

How to initialize object array with different parameters?

With the current interface, this is probably the best you can do: dim = [3,2]; param = 1:6; param = num2cell(param); %each...

4 Tage ago | 1

| accepted

Answered

What is the type of function Handle and How is it stored in memory?

Firstly, you seem to be using the term file handle for what everybody else call function handles. File handles are completely di...

What is the type of function Handle and How is it stored in memory?

Firstly, you seem to be using the term file handle for what everybody else call function handles. File handles are completely di...

4 Tage ago | 1

Answered

How to concentrate 5000 matrices of different row length (same column length) into one matrix by unfolding each of the matrices to the smallest row length

Where are the 5000 matrices in your code? As far as I can tell you've only got 6 matrices stored in the matrix field of the stru...

How to concentrate 5000 matrices of different row length (same column length) into one matrix by unfolding each of the matrices to the smallest row length

Where are the 5000 matrices in your code? As far as I can tell you've only got 6 matrices stored in the matrix field of the stru...

5 Tage ago | 1

| accepted

Answered

Detection of red color RGB

%extracting the Red color from grayscale image diff_im=imsubtract(data(:,:,1),rgb2gray(data)); That comment is very misleading...

Detection of red color RGB

%extracting the Red color from grayscale image diff_im=imsubtract(data(:,:,1),rgb2gray(data)); That comment is very misleading...

5 Tage ago | 0

Answered

Finding index values for consecutive values in cell array

Right, so your data is a 105x1 vector cell array of 3x3x2000 matrices. First, a function to get the average length of the sequ...

Finding index values for consecutive values in cell array

Right, so your data is a 105x1 vector cell array of 3x3x2000 matrices. First, a function to get the average length of the sequ...

5 Tage ago | 0

| accepted

Answered

Write video in wide screen format

Matlab assumes and always display the video with a pixel aspect ratio of 1:1. My guess is that your original video specify a di...

Write video in wide screen format

Matlab assumes and always display the video with a pixel aspect ratio of 1:1. My guess is that your original video specify a di...

5 Tage ago | 0

| accepted

Answered

Can I load .NET Core 2.2 DLL to Matlab on Linux?

While in theory you can use .Net core on linux (with mono), Matlab is very specific that its .Net interface only works on Window...

Can I load .NET Core 2.2 DLL to Matlab on Linux?

While in theory you can use .Net core on linux (with mono), Matlab is very specific that its .Net interface only works on Window...

5 Tage ago | 0

Answered

Error: Not enough input arguments

They can't be inputs of phi because I need to zero the function phi with fsolve. Yes, they can: function F=phi(P, Tc, Pc, T, o...

Error: Not enough input arguments

They can't be inputs of phi because I need to zero the function phi with fsolve. Yes, they can: function F=phi(P, Tc, Pc, T, o...

6 Tage ago | 0

| accepted

Answered

How do I fill lines between 2 values with interpolation

Probably, the easiest: startvalue = 1; endvalue = 10; numberofpoints = 19; %includes start and end point x = linspace(startv...

How do I fill lines between 2 values with interpolation

Probably, the easiest: startvalue = 1; endvalue = 10; numberofpoints = 19; %includes start and end point x = linspace(startv...

6 Tage ago | 0

| accepted

Answered

Do I need pre-allocation ?

Robin, in the 2nd case, yes you were attempting to preallocate the array. However, the array you preallocated is not the same ar...

Do I need pre-allocation ?

Robin, in the 2nd case, yes you were attempting to preallocate the array. However, the array you preallocated is not the same ar...

6 Tage ago | 2

| accepted

Answered

How can I rearrange the order of N matrix in Matlab?

Read Stephen's comment and follow the links to understand why your original design is very flawed. You want only one variable c...

How can I rearrange the order of N matrix in Matlab?

Read Stephen's comment and follow the links to understand why your original design is very flawed. You want only one variable c...

6 Tage ago | 0

Answered

Displaying empty array as output

Hopefully, your real code doesn't use the same indentation as what you've posted above. If it does, I suggest that you let matla...

Displaying empty array as output

Hopefully, your real code doesn't use the same indentation as what you've posted above. If it does, I suggest that you let matla...

6 Tage ago | 0

Answered

Choice of Database for smooth data import into Matlab

While excel can be used as a data source, I would hardly call it a database. Particularly, if you compare it to SQL databases. T...

Choice of Database for smooth data import into Matlab

While excel can be used as a data source, I would hardly call it a database. Particularly, if you compare it to SQL databases. T...

6 Tage ago | 0

| accepted

Answered

splitting data in a table when ever the cell is empty

Matrices can never have empty rows. What you call empty rows are rows with 0s in both columns. If I understood correctly what ...

splitting data in a table when ever the cell is empty

Matrices can never have empty rows. What you call empty rows are rows with 0s in both columns. If I understood correctly what ...

6 Tage ago | 0

| accepted

Answered

How to align multiple matrices based on the first column values?

The simplest way is convert your matrices to a table, which may make sense anyway considering that it looks like the columns of ...

How to align multiple matrices based on the first column values?

The simplest way is convert your matrices to a table, which may make sense anyway considering that it looks like the columns of ...

7 Tage ago | 0

| accepted

Answered

Index in position 2 exceeds array bounds (must not exceed 101)

My guess is that you want all the times, in which case: newsst = sst(newlat, newlon, :); Using time as an index into newsst ma...

Index in position 2 exceeds array bounds (must not exceed 101)

My guess is that you want all the times, in which case: newsst = sst(newlat, newlon, :); Using time as an index into newsst ma...

7 Tage ago | 0

Answered

Find the closest value in each group in a matrix column

Within splitapply, when min is invoked, it's invoked on a single group. Therefore, the index it returns refers to the index of t...

Find the closest value in each group in a matrix column

Within splitapply, when min is invoked, it's invoked on a single group. Therefore, the index it returns refers to the index of t...

7 Tage ago | 0

| accepted

Answered

Tab completion of struct within cell

The reason why tab completion doesn't work for the content of a cell array can easily be explained: matlab does not look into th...

Tab completion of struct within cell

The reason why tab completion doesn't work for the content of a cell array can easily be explained: matlab does not look into th...

7 Tage ago | 1

| accepted