Community Profile

# Guillaume

### University of Brighton

6 408 total contributions since 2012

View all

Contributions in
View by

Write a function called max_sum that takes v, a row vector of numbers, and n, a positive integer as inputs. The function needs to find the n consecutive elements of v whose sum is the largest possible.
Don't use the question title to post the content of your assignment as that get truncated. Assuming that your assigment is to f...

6 jours ago | 2

| accepted

splitapply cumsum with non-scalar result
The error message tells you exactly what to do: splitapply(@(x){cumsum(x)}, inputData, G) This will output a cell array, ...

6 jours ago | 0

| accepted

Expressing an even number in powers of 2 and a multiple of an odd number.
Can't you just use a loop? function [exponent, multiplicand] = decompose(number) validateattributes(number, {'numeric'}, ...

6 jours ago | 0

| accepted

code is too difficult to understand
I'm not sure what you're looking for here. We're not going to teach you matlab, so perhaps you should grab a book and/or read so...

6 jours ago | 0

Extract array information from date and create cell
dates = datetime(datestr(dates)); %... datenumber = datenum(dates); The trip through datestr is unnecessary. And converting a...

6 jours ago | 0

merging 8 bit planes into single plane by combining the values of each bit into 8-bit value for each pixel
No, imfuse will not work. imfuse has no concept of bits. Your question is actually very puzzling. You already know how to combi...

6 jours ago | 0

| accepted

Reading uint16 image and converting to uint8 problem
As far as I can tell, there is nothing wrong with the way matlab decodes your image. It genuinely have very little contrast with...

7 jours ago | 0

| accepted

How do I make a function accept a vector as an input
If you want to pass the first, second, third, or nth element of the input vector to your function, then tell matlab you want the...

7 jours ago | 1

| accepted

How to get the intersecting coordinates of a binary image?
You would use the 'branchpoints' operation of bwmorph to isolate the intersections, after you've skeletonised the image with the...

7 jours ago | 0

| accepted

how to optimise the code with cell?
Why are you using cell arrays in the first place? It's just slower and has more overhead than matrices. You can just create your...

7 jours ago | 0

| accepted

How to segment a paragraph into lines and words?
Of course it's possible to segment the file. It's fairly trivial as well. Just close the image (if you're working with white tex...

7 jours ago | 0

| accepted

Is is necessary to use set/get functions?
It's not been required since R2014b, where all graphics handles became proper objects. Now, it is just an alternative way of set...

8 jours ago | 0

| accepted

Error for C(i,:)
As per my comment to your question, clearly your code is full of bugs. To find out how your code actually behaves as opposed to ...

8 jours ago | 0

Dicomwrite, how to overcome limits of 32-bit?
As far as I know, the 2^32-1 limit is intrinsic to the DICOM format. The length in bytes of all objects is always encoded as a ...

8 jours ago | 0

| accepted

Categorising coordinates into a table
Is there any reason to store your data as a cell array instead of a 3D matrix (or two 2D matrices) which would make your life si...

8 jours ago | 1

| accepted

How to fill a 1024 point array with two cycles of a cosine wave?
Knowing that the cycle length of a cosine wave is , what is the length of two cycles? Once you know that, use linspace to gener...

8 jours ago | 0

How do I extract numbers from mixed data to create a table?
Your log1.txt file is encoded in UTF8 and starts with a BOM (a bit unusual). Reading as text without telling matlab it's utf8 ma...

8 jours ago | 0

Rearranging rows side by side based on a column value
I'm assuming that status 1 only happens once per ID. I'm also assuming that all rows of an ID are together. t = readtable('Inpu...

8 jours ago | 0

| accepted

Combine Vectors Into Matrix - NOT ALL Possible Combinations from baseline
allpoints = {[1 2 3 4], [7 8 9], [10 11 12 13], [14 15 16]}; %can be as many vectors of any length baseline = [1 7 10 14]; ass...

8 jours ago | 1

| accepted

Get Blob from Firebird SQL Database
So, what you're getting back is a java object of type org.firebirdsql.jdbc.FBBlob. You can use the methods of that object to get...

8 jours ago | 0

| accepted

How to put each group of cells in the same row ?
reshape(A, 16, [])' reshapes your cell array in columns of 16 rows (since matlab is column major). Then transpose to have rows ...

8 jours ago | 1

| accepted

Reading Specific Data Into MATLAB from an Excel File
One way: opts = detectImportOptions('Static_pose.xlsx'); %should automatically figure out what part of the excel file is a tab...

8 jours ago | 0

Intersection of two matrices based on 1st column
[~, rowstokeep] = setdiff(B(:, 1), A(:, 1)); %get index of rows in B whose 1st column is not in 1st column of A C = B(rowstoke...

8 jours ago | 0

| accepted

Warning while opening matlab R2018b
The most important part of the error is probably: Warning: Function assert has the same name as a MATLAB builtin. We suggest yo...

8 jours ago | 0

| accepted

How to efficiently replace NAN with Numirical value a reference vector
Certainly, the inner for loop is unnecessary (and the find, use logical indexing). Refr=[1 20 1 4 5 2]; WithNan=[1 NaN 1 3 2 ...

11 jours ago | 3

To change 12x12 matrix to 6X12
No need for a loop: m = randi([0 100], 12) %demo matrix newm = permute(sum(reshape(m.', size(m, 2), 2, []), 2), [3 1 2]) B...

12 jours ago | 1

Removing zeros in excel
No loop, no cellfun: filetoedit = 'C:\somewhere\somefile.xlsx'; [data, ~, ascell] = xlsread(filetoedit); ascell(~conv2(data...

12 jours ago | 1

| accepted

undefined function or variable matlab even the variable excite
A will only exist if both n and m are greater than 2. So if matlab tells you that A does not exist we can safely assume that eit...

12 jours ago | 0

number of special array in a table
It doesn't look like you have a table. It looks like a plain vector. Anyway, lengthofruns = diff([1; find(isnan(yourvector)); ...

14 jours ago | 1

| accepted