Community Profile

photo

Guillaume


University of Brighton

6,303 total contributions since 2012

Guillaume's Badges

  • Scavenger Finisher
  • Thankful Level 1
  • 36 Month Streak
  • Master
  • Leader
  • Puzzler
  • Creator
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer
  • Scholar
  • Speed Demon
  • CUP Challenge Master
  • Promoter
  • ASEE Challenge Master

View all

Contributions in
View by

Answered
choose row cell of matrix
C = cellfun(@(rows) A(rows, :), B, 'UniformOutput', false) or if you prefer a loop: C = cell(size(B)); for idx = 1:numel(B) ...

1 day ago | 0

Answered
Read text file with blocks of recurring pattern
This is how I'd do it: %1. Parse the file blocks = []; %matrix to receive each block steps = []; %to s...

2 days ago | 1

| accepted

Answered
Error using horzcat Dimensions of arrays being concatenated are not consistent.
For whatever reason,I keep on getting this annoying error There is nothing obscure about the error, and it's puzzling why you c...

2 days ago | 1

| accepted

Answered
how to release indexes in an array
A much simpler way to obtain your r (and e): [uvals, ~, id] = unique(arr); r = accumarray(id, 1); e = find(r > 1); which als...

2 days ago | 0

Answered
How to counting frequency of a value occurence in a matrix?
Since you're passing a column vector to histc (X(:)), the output is going to be a column vector. Hence you're trying to concaten...

2 days ago | 0

Answered
comparison of the fields of two structures with a condition
If all the fields are scalar, you don't need any special function. I'm assuming that there can be at most one i and j for which ...

2 days ago | 0

| accepted

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

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

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

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

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

3 days ago | 0

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

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

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

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

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

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

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

4 days 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, ...

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

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

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

6 days 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 days 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 days ago | 0

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

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

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

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

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

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

9 days ago | 0

| accepted

Load more