Respondida
Converting a list of binary numbers to a decimal numbers
Replace load('accumulator_output.dat'); accumulator_output_string = num2str(accumulator_output); by S = readlines('accumulat...

casi 4 años hace | 0

| aceptada

Respondida
Can you help me with an error on my GUI program ?
Do not append folders to Matlab path only to import files. This is a source of unexpected behavior. Include only the folders con...

casi 4 años hace | 0

Respondida
How to preallocate 2D array before for loop?
Do not collect the points, but a list of their indices. If you use logical indexing, you can omit the expensive unique also: n ...

casi 4 años hace | 1

Respondida
Decrease spacing between plots in matlab
You find many code for modyfying the position of subplots in the FileExchange: https://www.mathworks.com/matlabcentral/fileexch...

casi 4 años hace | 0

Respondida
Automatic Download from a Url when the file of the date is inputted by the user
This can be implemented with sprintf() or compose() easily. url_https='https://data.cosmic.ucar.edu'; for year = 2020:2022 % ...

casi 4 años hace | 1

| aceptada

Respondida
Out of memory error
32*20*1024*2047*42* 8 byte per element => Your array snack uses 451 GB RAM. If alldat contains additional data, the total amount...

casi 4 años hace | 0

Respondida
After using griddata, standard deviation is changed.
Of course increasing the number of points by an interpolation reduces the standard deviation: std([1,100]) std(interp1([1, 2],...

casi 4 años hace | 0

Respondida
how to find a number in cell and make it NaN?
Start with a simple loop: A = {[1,2], [3,4], [5 31], [31,6]}; B = A; for k = 1:numel(B) b = B{k}; m = (b == 31); ...

casi 4 años hace | 0

| aceptada

Respondida
Why this message appears?
The message is clear: "Out of memory" means, that the size of the data, you try to load, exceeds the available RAM. Install mor...

casi 4 años hace | 0

Respondida
Why the function "timeit" doesn't work correctly
timeit and tic/toc measure the runtime. If they determine a runtime of 4 seconds in Matlab R2014 and just 0.3 seconds in Matlab ...

casi 4 años hace | 1

| aceptada

Respondida
Getitng error suggesting that I should "Use rotate(app, ...) to call this function.". How should I format my code?
rotate is a built-in function: https://www.mathworks.com/help/matlab/ref/rotate.html Use another name for your function.

casi 4 años hace | 0

Respondida
how can I plot y = (cos(t-2)/4)(rect(t+1)/6 )?
y = @(t) cos(t-2) / 4 .* rect(t + 1) / 6; fplot(y)

casi 4 años hace | 0

Respondida
How to concatenate numbers with ( ) bracket as cell type?
As Walter said already: If it contains parentheses ( and ), the elements of the cell cannot be numerical. in = [-5,21,-5;-5,21...

casi 4 años hace | 0

| aceptada

Respondida
Using find() is faster than direct logical indexing?
No relevant difference in R2022a in the forum: A=randi(100, 5e3, 5e3); % Few elements only timeit(@() useFind(A)) timeit(@()...

casi 4 años hace | 1

| aceptada

Respondida
speed up for and if loop
isnan replies trtue or false. There is no need to compare it with ==1 afterwards. nWasserhoehe = size(Wasserhoehe_HQ, 1); FRI_...

casi 4 años hace | 0

Respondida
Print a specific PDF file using its path?
Guessing, that you use Windows: Acrobat = '"C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"' PDFFile = '"C:\your.pdf"';...

casi 4 años hace | 0

Respondida
For-looping output not adequate
new_parameter(i) = T2(i) - T2(i-(time*mult)); In the first iteration the i.th element of the vector new_parameter is ca...

casi 4 años hace | 1

Respondida
missing parts of a figure when converting to pdf
Copied from my suggestion in the comments: Disable the clipping of the axes object: axes('Clipping', 'off')

casi 4 años hace | 2

| aceptada

Respondida
How may I use reshape for this code?
Your loop method overwrites b(j) repeatedly. Setting count to 0 in two lines is confusing. Simpler: for j = 1:frame_number ...

casi 4 años hace | 0

| aceptada

Respondida
How to calculate execution time in Matlab?
The direct method: tic x = sin(rand(1e4, 1e4)); toc The smart method: timeit(@() sin(rand(1e4, 1e4)))

casi 4 años hace | 1

| aceptada

Respondida
Iteration repeat several times
Avoid including each variable in parentheses. This reduces the readability. Matlab processes terme from left to right. Then: i...

casi 4 años hace | 0

| aceptada

Respondida
How to get internet time?
This java code does not run here in the forum. Maybe it is blocked by a firewall. Please try it in your local Matlab instance: ...

casi 4 años hace | 0

Respondida
'improfile' is a missing function in octave, what other options could I use to make my loop works?
The command interp2(I, 2) does not consider the selected line. Better: n = ceil(norm([diff(x), diff(y)])); % A rough estimatio...

casi 4 años hace | 1

Respondida
Hide excel sheet form Excel file
According to the links you have posted it should work like this: Sheet = get(Sheets,'Item',2); Sheet.Visible = 'xlShee...

casi 4 años hace | 0

| aceptada

Respondida
Numerical Inaccuracies for Ranges of Parameters When Using ode45 for Two Identical (But Transformed) Systems
I confirm the observed instabilities. The result depends critically on the initial value and the parameters. The trajectory has ...

casi 4 años hace | 0

Respondida
xlim not working in 'loop' plots..
You do not call the function xlim() at all, but create a variable with the same name. Replace: xlim=([1 100]) by xlim([1 100...

casi 4 años hace | 1

Respondida
find certain numbers in txt file
FileName = '20220727_150919_results.txt'; S = fileread(FileName); C = strtrim(strsplit(S, newline)); m = find(strcmp(C, 'Shad...

casi 4 años hace | 0

| aceptada

Respondida
for loop for signal with changing conditions?
Do you mean: for i = 1:length(MomentRechts) % Instead of: for i´= length(MomentRechts) This command processes the comple...

casi 4 años hace | 0

Respondida
every for loop never stops running
Neither uninstalling Matlab nor a virus scanner can be the solution. Don't try wild things, because "gunshot-programming" is not...

casi 4 años hace | 0

| aceptada

Respondida
Error in multi-screen
Most of the messages are just informations. The actual error is: Error in posner_forpilotingerps_June32022 (line 50) fixation ...

casi 4 años hace | 0

Cargar más