Réponse apportée
Callback slow when large object array loaded into function context
I suspect you meant JH=JustHandle.MakeArray(200000); I can't explain the behaviour, however note that load is known to preven...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
cant find the white pixels
I suspect you're getting confused with your coordinates. In particular, the names of the variables in your line: [c, r] = find(...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I call an event Function in AppDesigner
Ah, so you want to call a control from the statupFcn, that makes more sense. If you're not using the event argument in the func...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
change a value in matrix
Note that idx = randi(size(A, 1)); would make more sense than randperm with just one element output. Anyway, randomrow = ran...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
how to get rgb value of image (using col,row) in app designer?
ginput does not round the clicked coordinates to the nearest integer, so you'll have to do that yourself. Also check that that t...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Saving images with a new name extracted from the old image name
One possible way, baseFileName = '2019-03-14 11-15-49.498_CAM2_4_3.bmp'; %for example outputFileName = regexprep(baseFileN...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
save part of a stucture
The -struct option of save saves each field of the structure as individual variables. Obviously for that to work the structure h...

plus de 7 ans il y a | 3

| A accepté

Réponse apportée
Invalid file identifier.Use fopen to generate a valid file identifier.
You don't show where fid comes from, but clearly matlab failed to open the file you tried to open. There can be many reasons for...

plus de 7 ans il y a | 0

Réponse apportée
How could I change this Python code to Matlab?
As Rik says there's no tool to convert python code into matlab so you'd have to do that manually, first by understanding what th...

plus de 7 ans il y a | 1

Réponse apportée
Extracted Features in .MAT files
It's hard to give you proper code without knowing the exact code you're using. It would go something like this: samplesigna...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can delete matrix randomly?
It looks like you've deleted rows not columns. y(randperm(size(y, 1), 3), :) = []; %delete 3 rows at random y(:, randperm(si...

plus de 7 ans il y a | 0

Réponse apportée
how to calculate derivative of a string
Replace your str2func, by str2sym to create a symbolic expression: eq='x^2+x'; f = str2sym(eq); g = diff(f);

plus de 7 ans il y a | 0

Réponse apportée
matrix log of certain columns
Simply, result = log(matrix1) + log(matrix2); then, result(:, 1) is your log(m1c1) + log(m2c1), result(:, 2) is your log(m1c2)...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to seasonalise daily weather classification and precipitation data
Up on the right of the page, there is a field for you to tell your version of matlab. Since it's not filled, I'm assuming a mode...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Is it Possible to Assign Aligned Memory to a *mxArray?
It is most likely that matlab arrays are already aligned but in any case, you can't use your own memory allocator for matlab arr...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Logical Indexing: Using a 1x18 array to build a 200*18 matrix
Simply: rebuildcost = sum(failmatrix .* costmatrix, 2);

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
sample rate (Fs) in audiowrite
Yes, the documentation does not match the actual code of audiowrite, at least in R2018b and R2019a. The documentation states tha...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to set an array identifier within code
Trying to build the indices as text is never going to be efficient. What you want can be trivially obtained: %A: an N-d matrix ...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How replace NaN's in a 3d field with the nearest value in the same column?
fillmissing(your3darray, 'previous', 3) %fill nans with previous element along 3rd dimension Possibly, with an optional 'EndV...

plus de 7 ans il y a | 0

Réponse apportée
How can I efficiently generate an incidence matrix based on Euclidean distance?
Sure you can process it in blocks: centrestep = ??? inputstep = ??? centreblocks = ceil(numel(centres) / centrestep); i...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
sscanf to extract numbers from string
sscanf format is different from sprintf. In particular there's no .2 notation for %f, so your .2 is interpreted as a literal .2 ...

plus de 7 ans il y a | 0

Réponse apportée
Find all possible combinations of 2 vectores (spin) of a system with N atoms with pondered distance
You have to bear in mind that most of us probably don't work in the same field as you do. Last time I had to worry about atom sp...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Obtaininig an array, which corresponds to one one of the diagonals of a given matrix, without using loops
Use the diag function: M = [1 2 0 8 5 1 2 3 8 7 8 5 0 3 5 6 7 4 8 2 1 2 0 4 5] >> diag(M, 2) %...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
TRANSPOSE(.') / RESHAPE too much TIME CONSUMING--> Looking for ALTERNATIVE
I fund it really weird that, for a computer, selecting a simple raw from a matrix is that time consuming It's always a lot slow...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
read inconsistent ascii file to matrix
Unfortunately, there's no ignore invalid lines for textscan, so you're going to have to parse the file line by line, or implemen...

plus de 7 ans il y a | 0

Réponse apportée
Unable to tweet from Matlab
According to this example, the base url to post tweet is baseurl = 'https://api.twitter.com/1.1/statuses/update.json'; not th...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
MATLAB Coder regexp Alternative
I know nothing about coder, don't have the toolbox. Reading the documentation of coder.ceval, I find it very incomplete. It ment...

plus de 7 ans il y a | 0

Réponse apportée
find the onset of a task in an array with the use of for loops
A loop would be a waste of time: function [event_scan_number, event_value] = function1(E) %what a rubbish function name! What ...

plus de 7 ans il y a | 1

Réponse apportée
Index in position 2 exceeds array bounds (must not exceed 6).
Your code: word1 = {'A','L','P','A','C','A'}; so, word1 is a 1x6 cell array, 1 row, 6 columns search = 10; for p = 1:search ...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
how can MATLAB handle .NET methods that have a REF parameter?
If we go by your .Net code, the correct matlab version should be: id = int32(0); %you probably don't even need the int32. mat...

plus de 7 ans il y a | 0

| A accepté

Charger plus