Respondida
Is it possible to group some strings of code, in order to shorten the visualization of the script?
You do not mean "strings". Strings are characters enclosed in double quotes. With "open and close groups" you mean the folding c...

alrededor de 4 años hace | 1

| aceptada

Respondida
Make Variable Names in a table numbers
Header are strings, not numbers. You cannot use numbers to be a header. allData = reshape(1:64, 8, 8) t = array2table(allData)...

alrededor de 4 años hace | 0

| aceptada

Respondida
mat1(mat2) = mat1 assignment
The pattern is trivial. I do not understand, what is unclear: t1 = [ 0 1 2 3 4 5 6 ]; t2 = [ 7 6 5 4 3 1 1 ]; t1(t2) = t1; ...

alrededor de 4 años hace | 1

| aceptada

Respondida
Why doesn't Matlab recognize my data format?
a = datetime('28/02/2018', 'InputFormat', 'dd/MM/uuuu') b = datetime('29/02/2018', 'InputFormat', 'dd/MM/uuuu') % FAILS: % Un...

alrededor de 4 años hace | 0

Respondida
minimal path sum in a MxN matrix from top left to bottom right with only Down and Right Moves available
A brute-force approach: M = 8; N = 8; X = randi([0, 1], M, N); % Now you need M-1 moves down and N-1 moves to the right. ...

alrededor de 4 años hace | 0

| aceptada

Respondida
Stop an infinite loop with a key
You delete the waitbar in the first iteration: delete(hWaitbar); Remove this line. or move it behind the loop. I cannot imagi...

alrededor de 4 años hace | 0

| aceptada

Respondida
Href hyperlink, how to escape double quotes " ?
I'm curious: % [UNTESTED] [TYPO FIXED] disp(['<a href="matlab:system(', ... 'strrep(''explorer.exe /select, $C:\My folde...

alrededor de 4 años hace | 0

Respondida
How to have different scales in the same x axis?
Set the XTickLabels accordingly with fake XTicks: X = [1,2,3,4,5,6, 100]; Y = rand(size(X)); axes('NextPlot', 'add', 'XTick',...

alrededor de 4 años hace | 0

Respondida
Grouping the Elements of the Array
x = rand(897880, 1); nx = numel(x); len = 300000; tile = [repelem(len, floor(nx / len)), rem(nx, len)] xC = mat2cell...

alrededor de 4 años hace | 0

Respondida
Can I run matlab, interacting with its GUI, on another PC?
This sounds like a job for the Parallel Server: https://www.mathworks.com/help/matlab-parallel-server/index.html?searchHighlight...

alrededor de 4 años hace | 1

Respondida
[Beginer] How can I change a loop which depends on file's time into a one which depends on name's files ?
As far as I understand, you want to process a list of files in alphabetical order. This is the order replied by dir(), but unfor...

alrededor de 4 años hace | 0

Respondida
how to shift a subscript upwards in Matlab plot legend?
plot(1:10) legend('$V_c$', 'Interpreter', 'latex', 'FontSize', 15) figure plot(1:10) legend('$V_{\raisebox{1ex}{c}}$', 'In...

alrededor de 4 años hace | 0

Respondida
Why am I not getting desired output?
neural_circuit function neural_circuit h = 0.05; t = 1:h:500; y0 = [2.5, 3.6, 9.5, 8.8, 2, 3, 7, 7.5]; % t(1) =0; y = ...

alrededor de 4 años hace | 0

Respondida
How to zero out short non-zero regions in vector?
With FEX: RunLength : A = [4 5 6 5 0 0 5 6 2 0 3 4 6 7 8 0 4 5 0 0 0 7 2 1 9 9 0]; minLen = 3; [b, n] = RunLength(A == 0); ...

alrededor de 4 años hace | 0

Respondida
How can I scan sets of multi variable in a simple version?
Take into account rounding errors: testing for cross(x,y)==0 is not stable. Remember, that the output of cross is a vector. So m...

alrededor de 4 años hace | 0

Respondida
How to write this formula in Matlab
Ufin = sqrt((1 / n * sum(Ustat .^ 2))^2 + Ucalib .^ 2)

alrededor de 4 años hace | 0

Respondida
how to sum cell elements in a dynamic cell table
Maybe: A = num2cell([1:6; 2:2:12; 3:3:18]); % Some test input S = size(A); % Size of the input ini = ones(1, S...

alrededor de 4 años hace | 0

| aceptada

Respondida
why is this Matlab Code faster than the C++ code below? I want to understand what Matlab internally does better and faster than C++
Not an answer, but an improvement of the Matlab code, which run in 10.7 sec on my R2018b i5m instead of 13.0 sec of the original...

alrededor de 4 años hace | 1

Respondida
Hi every body, I write this code and I want to find a new Sol and Soll in iteration 1000 or more but the problem that the answer go to Nan?!
Use the debugger to find the iteration, which causes the NaNs: dbstop if naninf Then Matlab stops, when the first NaN occurs. ...

alrededor de 4 años hace | 0

Respondida
Why is saveas() changing my image aspect ratio?
Try to set the 'PaperSize' property of the figure.

alrededor de 4 años hace | 0

Respondida
precision of double variables
Welcome to the world of numerics with limited precision. These are the expected effects. You observe the value mentioned in the...

alrededor de 4 años hace | 0

Respondida
Summation of every nth column
S = size(LoadProfile); X = reshape(LoadProfile, S(1), 4, S(2) / 4); X = reshape(sum(X, 2), S(1), S(2) / 4).'; Result = X(:);

alrededor de 4 años hace | 0

Respondida
Why am I getting the error "not enough input arguments"?
The function handle provided to fminsearch must accept 1 input argument. fminsearch cannot guess, that H0 should be provided als...

alrededor de 4 años hace | 0

Respondida
Log Error and Warning Messages to Text File
You can catch errors using try-catch and write the messages whereever you want. Redirecting warnings is more tricky. I use my o...

alrededor de 4 años hace | 0

Respondida
All tables being vertically concatenated must have the same number of variables.
I assume you want an "outer-join": https://www.mathworks.com/help/matlab/ref/outerjoin.html Output = table(); for kk = 1:nume...

alrededor de 4 años hace | 0

Respondida
Integration approximation with function handle
f = @(a,b,h,f0) ((a+(n-1)*h+a+n*h)/2)*f0; This cannot work if f0 is a function handle. This is at least confusing: for n=1:n ...

alrededor de 4 años hace | 0

Respondida
why do I get -Inf
alpha = 0.5; u0 = 0; a_k = @(k) (k + 1)^(1 - alpha) - (k)^(1 - alpha); n = 100; a = 0; b = 1; h = (b...

alrededor de 4 años hace | 1

| aceptada

Respondida
generate an independent seed with a fixed number
rng('default') is the default seed at the start of the Matlab session. All subsequent requesrts of random numbers move the see...

alrededor de 4 años hace | 0

Respondida
imshow is not working
You have created a script called "image.m". This shadows the built-in function image. Shadowing built-in functions is a serious...

alrededor de 4 años hace | 0

Respondida
Can parfor be used in this context?
"Can I use parfor in a context where the second iteration depends on the results of the first iteration." No, you can't for obv...

alrededor de 4 años hace | 0

| aceptada

Cargar más