Answered
create function in loop
Simplify F_sum4 = 0; start=1; stop=810; for n = start:stop F_sum4 = F_sum4 + F(:,:,n) CY_sum4 = mean(cy_sum(start:...

20 días ago | 0

| accepted

Answered
I can't open and uninstall due to the error, how to resolve it?
The message suggest to re-install Matlab. So do this: install it over the existing version.

20 días ago | 0

Answered
Read the original output variable of function
This is impossible. If the code is not visible for the user, the names of the variables are not visible also. But remember, that...

20 días ago | 0

Answered
How can I use the ( nchoosek ) for this case nchoosek(x,y) where x=[1:1:80] , and y=64;
80 over 64 is 26'958'221'130'508'525. Then nchoosek(1:80, 64) needs 26958221130508525 * 64 * 8 Bytes in the RAM, which is 1,38 P...

20 días ago | 1

Answered
Decimal and very small values returning zeros
No, Matlab uses the standard IEEE754 conventions and has no rounding errors. The question is funny: A huge number of scientists...

21 días ago | 0

Answered
vectorize nested loops interpolation
% Your code: a_min = 1e-10; a_max = 1; na = 200; a_grid = linspace(a_min,a_max,na)'; Nsim = 10000; % Desired value is la...

21 días ago | 1

| accepted

Answered
Plot one data set with two different units?
This is a lot of information and code, which has no relation to the actual problem. What exactly is the detail you want to chang...

22 días ago | 0

Answered
Is it possible to set a vector as an users input'
Such inputs are obtained using a GUI usually. The callbacks of the edit fields control the type of the input. A loop would be e...

22 días ago | 1

| accepted

Answered
Why are xlsread (and readtable) doing such a poor job at loading mixed data files?
The automatic detection of string types is known to be a source of severe bugs. The genes "Dec1", "SEPT1" and "MARCH1" have been...

22 días ago | 1

| accepted

Answered
How to skip NaN arrays outputs of a for loop?
doBreak = false; for Nj2 = 1:cj2 for Mj2 = 1:rj2 J2= j2(Mj2,Nj2); e3=(exp(C1_p).*hermiteH(M-M2...

22 días ago | 0

| accepted

Answered
Is it possible to denormalize data created via the 'units', 'normalized' handles? /where does the handle get it's inputs from?
About the reverse of the normalize() function: This is impossible. See: X = 1:5; normalize(X) normalize(X + 1) After the nor...

22 días ago | 0

Answered
My mex file is slower than my original matlab equivalent
Just some experiments. You can gain some clarity, but hardly improve the speed with this simplifications. I've tried a loop vers...

22 días ago | 0

| accepted

Answered
not enough input arguments, odes
See: Answers: Anonymous function to provide parameters k1 = rand; k2 = 18; etc = 21.7; ... and so on [t,x] = ode45(@(t,x) o...

22 días ago | 0

Answered
Using cellfun to pull information
cellfun works on cell arrays, as the name says. You are working with tables. So this command does not match at all. Color1 = ["...

22 días ago | 0

| accepted

Answered
Converting a vector of structs to just one struct (vectorizing)
X = cat(1, S(:).FieldName); % Or shorter: X = cat(1, S.FieldName); % Example: S(1).FieldName = [1,2,3]; S(2).FieldName = ...

22 días ago | 0

| accepted

Answered
how to Enter same string in whole column?
T = table('Size', [5, 2], 'VariableTypes', {'string', 'double'}); T{:, 1} = "str"

24 días ago | 0

Answered
Not pausing on error in unit test
If the errors are caught by TRY/CATCH blocks, you can stop Matlab and enter the debug mode by: dbstop if caught error Type thi...

25 días ago | 0

Answered
Vectorization of nested loop
It is hard to improve the speed of code without having data to run the code. But start with calling interp1 once only. Q = i...

25 días ago | 0

Answered
How to make two for loop plots appear next to each other at the same time?
Move the code of both loops into one loop. Define the parent of the dranw objects. Example: FigH = figure; Axes1 = subplot(1,...

25 días ago | 0

| accepted

Answered
cannot assign values to a cell during a parfor loop
Try this: fold_list = cellstr(strcat('Folder_',num2str((100:125).','%#4.d'))); % By the way: Simpler: % fold_list = sprintf...

25 días ago | 1

| accepted

Answered
Changing elements of row after certain element
x = [-1,-0.65,-0.45,0,0.3,0.8,1,0.4,0.2,-0.1]; idx = find(x == 1, 1); if ~isempty(idx) x(idx + 1:end) = 0; end

26 días ago | 1

Answered
Importing data without using read functions
T = fileread(Text); C = strsplit(T, newline); Head = strsplit(C{1}, ','); Body = reshape(split(C(2:end), ','), numel(C) - 1...

26 días ago | 0

Answered
Conversion to cell from double is not possible.
If a variable is not defined before, the default type is double . You want to access a as a cell, so define it accordingly: a =...

26 días ago | 0

| accepted

Answered
How to continue loops with few if statement between them
This is nicer without a loop: mean_travel1 = sum(arrival(depart_time < 100,1)); mean_travel2 = sum(arrival(100 < depart_time &...

27 días ago | 0

Answered
what am i doing wrong in this equation?
There is no need for symbolic calculations or the solve command: [x, y] = meshgrid(0:0.2:4, 0:0.2:4); z = sin(y + 5) + 5 * sin...

27 días ago | 0

Answered
Find the rows that have common elements for 4 arrays
What about: intesect(intersect(intersect(in1(:,9), in2(:,9)), out1(:,9)), out2(:,9))

28 días ago | 0

| accepted

Answered
Profiler will not open
Maybe a user-defined function shadows a function used to start the profiler. Try https://www.mathworks.com/matlabcentral/fileexc...

29 días ago | 0

Answered
understanding the reshape function
reshape changes the dimensions of an array without changing the number of elements or their order. If you provide an empty matri...

29 días ago | 0

| accepted

Answered
calculate mean for elements of each column in a cell array sub-entry
Of courser you can use mean and sum for double arrays. Why do you think, that this is not possible? cell_array{3,1} = magic(4);...

29 días ago | 0

Answered
Use fprintf name of array within the script
The main problem is to have a bunch of variables with an index hidden in the name. Don't do this. Store the data in an array. Th...

29 días ago | 0

Load more