답변 있음
Find the value of r such that the determinant of A is zero.
Remember, that Matlab uses IEEE754 doubles with limited precision. Then -5.5511e-17 is almost 0. The result is correct. See: ht...

거의 4년 전 | 0

| 수락됨

답변 있음
startup script for whole team
I use a tool to syncronize a function, which is updated by others in this forum: https://www.mathworks.com/matlabcentral/answers...

거의 4년 전 | 0

답변 있음
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:...

거의 4년 전 | 0

| 수락됨

답변 있음
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.

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 1

답변 있음
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...

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 1

| 수락됨

답변 있음
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...

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 1

| 수락됨

답변 있음
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...

거의 4년 전 | 1

| 수락됨

답변 있음
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...

거의 4년 전 | 0

| 수락됨

답변 있음
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...

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 0

| 수락됨

답변 있음
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...

거의 4년 전 | 0

답변 있음
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 = ["...

거의 4년 전 | 0

| 수락됨

답변 있음
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 = ...

거의 4년 전 | 0

| 수락됨

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

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 0

답변 있음
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,...

거의 4년 전 | 0

| 수락됨

답변 있음
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...

거의 4년 전 | 1

| 수락됨

답변 있음
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

거의 4년 전 | 1

답변 있음
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...

거의 4년 전 | 0

답변 있음
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 =...

거의 4년 전 | 0

| 수락됨

답변 있음
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 &...

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 0

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

거의 4년 전 | 0

| 수락됨

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

거의 4년 전 | 0

답변 있음
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...

거의 4년 전 | 0

| 수락됨

더 보기