Answered
Using Logical Operators && and ||
I may sound like a broken record but I keep on saying on this forum: Don't number variables. If your variables are numbered, it'...

7 years ago | 1

Answered
memcached data access in Matlab
Why your question is not urgent or an emergency No there is no support in matlab for memcached. You would have to create a cust...

7 years ago | 0

Answered
How to filter a matrix Row by Row to get the highest value?
A version with no loop, but a few accumarray so may not be faster: %build demo data A = [31,62.3, 31,96.3, 31,52.8, 57,91.4...

7 years ago | 1

Answered
How to store fprintf statements into a txt file?
You can pass a file identifier to fprintf (after you've opened the file), e.g.: fid = fopen('Test.txt', 'wt'); fprintf(fid, 'S...

7 years ago | 1

| accepted

Answered
MATLAB Coder regexp Alternative
Like Walter, I was going to suggest delegating to another regular expression engine. Note that in modern C++ (C++ 11 and later),...

7 years ago | 0

Answered
read file with ascii characters and binary data on one single line
Right, now that we've resolved that the published int32 were incorrect. Here how I would parse the file. fid = fopen('20190322...

7 years ago | 2

Answered
Obtaining contents of a column in a table corresponding to specific contents of another column in the same table
You shouldn't use a loop for this sort of things. Operate on the whole columns at once: col1 = ['n1'; 'n2'; 'n3'; 'n4';'n5'; 'n...

7 years ago | 0

| accepted

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

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

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

7 years ago | 1

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

7 years ago | 0

| accepted

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

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

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

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

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

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

7 years 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, []);...

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

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

7 years ago | 2

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

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

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

7 years ago | 0

| accepted

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

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

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

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

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

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

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

7 years ago | 0

Load more