Answered
How can I fopen/fwrite into memory, or convert my fread double array
Do you have SSD or HDD on your computer? SSD is much faster and perhaps this is the easy solution. Otherwise, you'd have to mak...

5 years ago | 0

| accepted

Answered
How can i handle a large amount of data (near about 16*10^10).
Save the random numbers to hard drive via |fwrite| and read the numbers from file via |fread|. OR, just control the random numb...

5 years ago | 0

Answered
Variable not printing to csv
Found an old code of mine. Does this work? % C = {'a', 'b', 'c'; 'a1', [2 3 4], 3}; % writeCell2CSV(C, 'tester.csv'); ...

5 years ago | 1

Answered
How do I rename sound files in a folder?
Use |movefile| to rename a file from BAD_NAME --> GOOD_NAME. But, BACKUP YOUR FILES before doing this for the first time! Bugs c...

5 years ago | 0

Answered
Matlab freeze when fprintf to file
Instead of 'test.m', write to 'test.txt' or something else. The fprintf is fast, but having a "test.m" file in the current direc...

5 years ago | 0

| accepted

Answered
How to force a for loop to continue?
<https://www.mathworks.com/help/matlab/ref/try.html> Use try/catch statements to force a loop to continue due to an unexpecte...

5 years ago | 0

| accepted

Answered
How can I vectorize Imread for loop to run faster?
Your current method for using |for| loop is okay, as vectorizing is more for matrix manipulation + math. This for loop could be ...

5 years ago | 0

Answered
HOW TO CHECK THE PARAMETERS RECEIVED IN THE FUNCTION CALL?
I think input parser + varargin is what you need here. * <https://www.mathworks.com/help/matlab/ref/inputparser.html> * <ht...

5 years ago | 1

| accepted

Answered
How to extract the max items in struct?
When you say "max", did you mean "max number of elements" or "max value within a vector"? Did you want something like this? ...

5 years ago | 1

| accepted

Answered
How to remove data points above or below a value in an array, nicely!
I think this is what you're trying to do: GoodRow = ~any(PRE_A(:, 2:9) <= 750 | PRE_A(:, 2:9) >= 920, 2) PRE_A = PRE_A(...

5 years ago | 0

| accepted

Answered
mex file crashes in loop
You should call |mex| once only to compile the code once. THEN, you summon the code in your loop. You don't need to call |mex| r...

5 years ago | 0

| accepted

Answered
Is there a simple way to condense the following codes?
Does this work? <https://www.mathworks.com/help/matlab/ref/varargin.html> function greek = OptionGreeks(opt, varargin) i...

5 years ago | 0

| accepted

Answered
How to read data from text file (combine text and datal)
FileName = 'PhantomASTM20180731000006.txt'; FID = fopen(FileName, 'r'); Data = textscan(FID, '%f%f%f', 'HeaderLines', 32...

5 years ago | 0

Answered
saving Plots in a loop
The outputs to |contour| is different from axes handles given by |surf|. You have to find the figure handle and feed that to the...

5 years ago | 0

| accepted

Answered
check parameter used by function with large memory
REAL NEW ANSWER You are generating a ton of invisible figure handles, and clearing the variable name without closing the figu...

5 years ago | 1

| accepted

Answered
print function with contour too slow
Here are the times in my computer. Do you need the '-tiff', '-r600' option for eps file? tic print('EPS_test.eps','-deps...

5 years ago | 0

Answered
How to extract specific frames from a video
Try this one. Seems like |read| is no longer recommended, and it's replaced by |readFrame|. I changed the variable names too, to...

5 years ago | 0

| accepted

Answered
Compiling .app from windows machine
Nope, this cannot be done due to the OS-specific library used. You'll have to compile in different OS. Yeah, it's a bit annoying...

5 years ago | 0

| accepted

Answered
Why does the standalone matlab (executable) code including the parallel computing feature do not work?
NEW ANSWER: Turn your script into a function. This is the same issue seen here for Matlab 2011 version: <https://www.mathw...

5 years ago | 1

| accepted

Answered
How can I fix the code?
For some reason, you're getting a NaN + NaNi, a complex imaginary NaN. Try to skip these, otherwise s will just become NaN + NaN...

5 years ago | 0

Answered
MATLAB crashes when saving figures in a loop
I'm suspecting an issue with the graphics card. <https://www.mathworks.com/matlabcentral/answers/103051-why-do-i-receive-a-segme...

5 years ago | 0

Answered
What does "cpsingle" function do? any idea how to see its code?
open(fullfile(fileparts(which('findchangepts.m')), 'private', 'cpsingle.m')) It's in a private folder, so you have to manua...

5 years ago | 1

Answered
need matlab source code of Strength patreto evolutionary algorithm
I wish we had a search engine that can search for "Strength patreto evolutionary algorithm matlab" and gives us a link to a matl...

5 years ago | 0

Answered
How to convert a GUI *.m file generated by GUIDE's export tool back to a *.fig file?
NEW ANSWER: How about this? 1) Export your guide .fig file as a single m file. EX: myGUI.m 2) >> h1 = myGUI 3) >>...

5 years ago | 0

Answered
Potential bug in the multi-core processing by utilizing "parallel computing" toolbox
That's called "Race Condition". Not a Matlab-specific bug, but a bug caused by improper multithreaded codes. Read more about thi...

5 years ago | 1

| accepted

Answered
How to output to GUI window?
Is this something you were aiming for? Not sure how your GUI is made, but here's a sample .m file you could start from. %myG...

5 years ago | 0

| accepted

Answered
How can I use created edit texts that were created by a pushbutton and (currently) have the same name?
Your "tag" is pretty much the variable name you store the uicontrol handle to. handles.textload = uicontrol(handles.p1, 'St...

5 years ago | 0

| accepted

Answered
GUI is remembering values entered last time it was open, how to stop this?
Oh... |global| variables are used. You should NOT pass GUI data to other functions via global variables. Otherwise your GUI will...

5 years ago | 1

| accepted

Answered
variable H1 can not be classified in parfor-loop
Take a read here for "sliced variables" <https://www.mathworks.com/help/distcomp/sliced-variable.html> parfor ii=1:(sub...

5 years ago | 1

| accepted

Answered
EXIST ignores leading slash
NEWER ANSWER FileLoc = dir('/license/license.json') IsFileThere = ~isempty(FileLoc) && any(~[FileLoc.isdir]); NEW ANS...

5 years ago | 0

| accepted

Load more