Community Profile

Guillaume

University of Brighton

6.882 total contributions since 2012

View all

Contributions in
View by

How to run macro in a different workbook
If the macro is supposed to act on the first workbook, the only way your excel procedure can work is if the macro rely on the Ac...

circa 6 ore ago | 1

What will be the output of of CD(1:8:8*16)=ciphertext
It simply replaces elements 1,9,17, 25, ..., 121 of CD by the elements of ciphertext. Since that's 15 elements of CD that are re...

circa 13 ore ago | 1

| accepted

Sort Through Cell And Put Corresponding Values In Their Respective Rows
This is how I'd do it: data = readtable('ML_Q_1.xlsx', 'ReadVariableNames', false); %optionally, give better name to the varia...

circa 15 ore ago | 1

| accepted

How to split a table based on date and hour
The easiest way is to use retime (requires a timetable) or groupsummary grouping by day, Of course, for matlab a day starts at 0...

circa 15 ore ago | 2

| accepted

Write a program to calculate the probability of two fair dice having sum equal to 7. There are two fair dice and we are interested in seeing whether the sum of the two fair dice having sum equal to 7. Use Monte Carlo Simulation.
Everything is fine with your code (although the calculation of n7 and nAll could be done with no loop at all), except for your c...

circa 17 ore ago | 1

| accepted

Dot indexing is not supported for variables of this type in a for loop
Typically, you'll get this error because the structure or object you're indexing with . is empty. Indeed, you have this bit of ...

1 giorno ago | 0

How can I create a (printable) image (jpeg, bitmap, tiff...any format is ok) starting from a binary code?
I understood that it's an art project but I'm worried that you're going to be disappointed with the results if you don't come up...

2 giorni ago | 0

There are a few issues with your code: you correctly query the size of your image and use that to preallocate your arrays, th...

2 giorni ago | 2

| accepted

Keep positive real values from a cell inside a matrix
I want to scatter all the positive real values of every cell In that case, I would convert your cell array to a 3D matrix. As I...

3 giorni ago | 0

| accepted

Swapping Letters Using Regular Expression
>> text = {'Fred', 'Replace', 'Cannot'}; >> regexprep(text, '([^aeiou]*)([aeiou])(.*)', '\$1\$3\$2') ans = 1×3 cell array ...

4 giorni ago | 0

| accepted

How to state that at least 80% of the values in my vector need to be positive
if mean(yourvector(150:end) > 0) >= 0.8 %assuming positive means strictly greater than 0 startindex = find(yourvector(150:...

4 giorni ago | 0

How to remove all the rows if first two columns has same number?
Two of many possible ways: yourmatrix(diff(yourmatrix(:, [1 2]), [], 2) == 0 , :) = []; yourmatrix(yourmatrix(:, 1) == yourm...

4 giorni ago | 0

How to use Uniquetol without sorting?
[~, colindices] = uniquetol(A', 1e-6, 'ByRows', true); %get indices of unique value. Is sorted BY VALUE B = A(:, sort(colindi...

4 giorni ago | 0

| accepted

how binary floating point to real decimal number representation ?
Yes, as Stephen said, be careful about the difference between binary numbers and IEEE storage. You can easily see the IEEE repre...

4 giorni ago | 2

| accepted

Interaction between MATLAB 32bit and MATLAB 64bit
I'm not clear why step 1 requires a particular bitness. The majority of databases will provide a 32-bit and 64-bit ODBC driver. ...

4 giorni ago | 0

Certain functions not available.
The answer to why you cannot use ischange in R2017a is simple. As written at the bottom of its documentation, it was introduced ...

5 giorni ago | 0

ismember(A,B,'rows') indexing
If the two cell arrays don't have the same number of columns, you're obviously not using ismember(A, B, 'rows') but something sl...

5 giorni ago | 0

Subtract according to the values in another column
one way: C1 = [1 1 1 1 1 2 2 2 2 2 2 3 3 3 4 4 4 4] %this is valid matlab syntax C2 = [5 10 12 35 3 1 4 26 5 11 12 8 2...

5 giorni ago | 0

| accepted

Plotting the orientation of lines
Not entirely sure what you're after, is it something like: A = [99.1862290400000 102.281400300000 97.1587243900000 ...

6 giorni ago | 0

Ignoring the fact that running arbitrary code is rarely a good idea, the simplest way to achieve what you want is to save your t...

6 giorni ago | 0

elimination of the chosen elements and rearranging the matrix
Deleting elements of an array while you iterate over elements of an array is never going to work. In any case, a loop is not n...

6 giorni ago | 2

| accepted

Creating multiple plots from a data file using a for loop
I see you've solved your problem, but for future reference the problem had nothing to do with plot. The problem was with your in...

6 giorni ago | 0

| accepted

html and uitable formatting with several features at the same time
If you're talking about uitable within a uifigure, then it does not support html formatting. See https://www.mathworks.com/matla...

6 giorni ago | 0

Adjacency matrix formation from n*n matrix
edgeData = [A, W(:)] Note that this is not an adjacency matrix. Also, you may actually want to input that into a graph or digr...

6 giorni ago | 0

| accepted

Find monthly mean from daily data of same year using find function
The easiest way: data = readtimetable('C:\somewhere\somefile.xlsx'); %may need some adjustement depending on the actual format...

6 giorni ago | 0

Probelm with 'writecell'
If the only thing you're trying to do is remove the first line of a text file, then parsing the file (with csvread, readcell, or...

6 giorni ago | 0

How can modify file name that imported by uigetfile.
Note that if it's for saving/exporting, you should use uiputfile instead of uigetfile. Regardless, all these functions do is re...

6 giorni ago | 0

| accepted

Error Using fscanf to open file
Why the conversion of filename to char? If it's not already a char array what is it? You should always check the return value o...

6 giorni ago | 0

Is it possible to annotate types so the tab completion works properly?
Matlab a way to customise tab completion with the functionsignatures.json file.It's not particularly well documented and when I ...

6 giorni ago | 1

| accepted