Answered
Generalizing an IF and FPRINTF expression
The code checks if B is greater than A so that the solid will sink in the atmosphere, it's to ensure that I didn't give wrong va...

7 years ago | 1

Answered
Why am i receiving an error that reads: Index in position 2 exceeds array bounds (must not exceed 1)?
Well, if you call your function with connect_the_dots(4,'*') it's no wonder you get an error, since points is simply the scala...

7 years ago | 0

Answered
How to loop column data
You keep mentioning loops when no loop is ever needed. I'm going to assume I was correct as to the result you want. this can be ...

7 years ago | 0

Answered
Find white pixels using for loop in certain rows/columns
Since you have three areas, it's probably easier to use a mask. The way I'd do it: %img1: image with white areas to fill %img2...

7 years ago | 0

| accepted

Answered
2018 release: Slow xlsread
I'm just curious is something was changed internal to the xlsread function It's not something that can be answered by us. We're...

7 years ago | 0

Answered
Delete rows of an A matrix using another B matrix
C = setdiff(A, B, 'rows')

7 years ago | 1

Answered
How can i have together in the same cell, lines with number values and one line with duration in HH:mm:ss:SSS?
Unfortunately, when you look at a cell array in the current version of matlab, matlab only shows the size and type of durations ...

7 years ago | 0

| accepted

Answered
@(x)sum(x.IsBranch)
cellfun is just a convenient way to iterate over all the elements of a cell array. It pass each element in turn to the function ...

7 years ago | 1

| accepted

Answered
Read a CSV file
Probably the simplest is to use readtable to import the data as a table. readtable should be smart enough to recognise that the ...

7 years ago | 0

Answered
Import specific type of text file
Your text file is a portion of a html file. As commented, html is not designed for data transfer and you would be better off fin...

7 years ago | 1

Answered
How to perform tensor summation without using "for" loop
A = [1 2 3 4; 5 6 7 8; 9 10 11 12]; rows = num2cell(A, 2); %split A, keeping columns together [rows{:}] = ndgrid(rows{:}); ...

7 years ago | 0

| accepted

Answered
Properties of a video
Documentation of VideoWriter writes about many properties of a videoclip, like FrameRate. Where in the code this can be used? N...

7 years ago | 0

| accepted

Answered
Cartesian product of list
This seems like a very odd thing to want to do, but it can be easily achieved with ismember: [~, whereinADBC] = ismember(ABCD, ...

7 years ago | 0

| accepted

Answered
how to display the sum of two values in GUI ?
I'm sorry to say that there are so many things wrong with your code that it's hard to understand why you thought it would work. ...

7 years ago | 0

| accepted

Answered
Table: Reshape based on Cell Column and Sort
unstack will do exactly that: >> t = table([1;3;1;2;4;2;3], {'AAA';'AAA';'BBB';'AAA';'BBB';'BBB';'BBB'},[100;500;300;250;50;NaN...

7 years ago | 0

| accepted

Answered
Index exceeds the number of array elements (1)
In the same vein as eps, don't use gradient as a name as it's already a matlab function. Note that using the names eps or gradie...

7 years ago | 0

| accepted

Answered
How to create a loop function for a set of parameters from a file to define each parameters as variables
In my opinion, the best thing would be change the way your read that file so that it's read directly into the variables (or bett...

7 years ago | 0

| accepted

Answered
How to unscale rescaled data?
You simply need to reverse the formula (which is given in the documentation of rescale. In your particular case: prediction_org...

7 years ago | 2

| accepted

Answered
Preallocate memory for a cell of structures
Just preallocating the cell array: x = cell(1, N); for ... There wouldn't be much point preallocating the scalar structures i...

7 years ago | 1

Answered
Save into cell or ND array
Numbered variables are always a bad idea. You won't be able to loop over them and referring to them in any generic way will forc...

7 years ago | 1

| accepted

Answered
Any help with a loop that is not performing calculations correctly?
elseif 1.2<distance4<2.8 while this is valid matlab syntax, it doesn't do what you think. The above compares 1.2 to distance, t...

7 years ago | 2

| accepted

Answered
Creating a loop with an empty Matrix
Note: an empty matrix (a matrix whose any dimension is of size 0) and a matrix filled with 0s are two completely different thing...

7 years ago | 1

| accepted

Answered
Getting specific values from 3D matrix
If the areas are different sizes, then you don't have a choice but storing them in a cell array. The code you have written is th...

7 years ago | 0

| accepted

Answered
trouble reading ordinal categorical variable with missing value using readtable
Unfortunately, I think you've hit a bug in readtable. Indeed, the problem is because readtable attempts to replace the missing v...

7 years ago | 0

| accepted

Answered
How to perform a for loop over a single excel column
I don't see the point of a loop. Simply use your 3rd column to construct a Nx3 matrix of colours: colours = [1, 0, 0 ......

7 years ago | 0

Answered
Add 0 to the front of a number.
no integer or floating point types store leading zeros Or rather, the OP is confusing the typographical representation of the n...

7 years ago | 2

Answered
Issues with populating a matrix using for loop and if conditional statements
There are many issues with your code, the usage of the horror that is assignin, probably the biggest one. Nowadays, I would also...

7 years ago | 0

Answered
Why can't the function handle the error in a given date input?
Your function errors if the inputs are invalid. In my opinion, it's much better coding than what you are asked, but you are aske...

7 years ago | 1

| accepted

Answered
How to convert csv file containing MAC addresses to JSON array
I'm assuming you want to use jsonencode to do the encoding. To be honest, considering the simplicity of your output, you could s...

7 years ago | 2

| accepted

Answered
Blockproc not working as I expected
Change your 'TrimBorder', true to 'TrimBorder', false. As it is you're removing a border of size 3 on each side of your output o...

7 years ago | 0

| accepted

Load more