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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 3

| accepted

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

7 years ago | 0

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

7 years ago | 1

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

7 years ago | 0

| accepted

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

7 years ago | 0

Answered
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);

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 2

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 1

| accepted

Answered
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) %...

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 1

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

Load more