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

más de 7 años hace | 1

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

más de 7 años hace | 0

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

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 1

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

más de 7 años hace | 0

| aceptada

Respondida
@(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 ...

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 1

Respondida
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{:}); ...

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 1

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 2

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

más de 7 años hace | 0

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 0

| aceptada

Cargar más