답변 있음
Test equivalence between mex and (.m) matlab functions
I store the compiled MEX functions in a specific folder. This is useful also to support different Matlab version, so each versio...

4년 초과 전 | 1

| 수락됨

답변 있음
array of structs how to preallocate and assign
An easy way is to create the struct array backwards: sa = struct([]); for k = 3:-1:1 sa(k).a = k; sa(k).b = rand; e...

4년 초과 전 | 0

답변 있음
Creating new arrays under conditions.
start = [5000, 7000, 12500, 14200, 19000]; stop = [4500, 8520, 14000, 14500, 21000]; keep = (abs(start - stop) >= 1000); n...

4년 초과 전 | 2

| 수락됨

답변 있음
How can I run two loops at a time?
The error message means, that I1(i,j) is a scalar, but smooth(sum(ILP,2)) is not. You cannot assign an array to a scalar. Mayb...

4년 초과 전 | 0

답변 있음
Automatically open new files as they appear in a folder
Under Windows this canbe done by .NET using a System.IO.FileSystemWatcher. But in general a simple timer is easier: % [UNTESTED...

4년 초과 전 | 0

| 수락됨

답변 있음
Early exit instead of a warning in ODE113?
In the current version of Matlab ODE113 does stop, when the integration tolerance is not met. The warning is shown an the integr...

4년 초과 전 | 0

답변 있음
Merge two saved figures in a single figure
The problem cannot be solved. "Figures" can contain a toolbar, a menubar, GUI elements like buttons and popup menus. If the 2 fi...

4년 초과 전 | 0

| 수락됨

답변 있음
Invalid use of operator.
Replace for ii~=jj by if ii~=jj A for command must have the structure: for counter = a:b and the ~= operator is not allowe...

4년 초과 전 | 0

| 수락됨

답변 있음
Error Index exceeds the number of array elements (0)
ind = find(segment < 0.5); lock(i) = ind1(ind(1)); If there is no element in segment, which is smaller than 0....

4년 초과 전 | 0

| 수락됨

답변 있음
Find indice of floating point number in matrix
find() does not fail on floating point arrays. If a floating point array is provided, find replies the indices of all elements, ...

4년 초과 전 | 0

| 수락됨

답변 있음
Building a custom image reader function in MATLAB
It is nearly impossible to write any useful code in Matlab without using builtin functions. See https://www.mathworks.com/matlab...

4년 초과 전 | 1

답변 있음
convert strings of multiple numbers into matrices
% Contents of the text file: % [[-0.4888 -0.4661 -0.7374 54.5679] % [-0.4835 0.8483 -0.2157 25.8953] % [ 0.7262 0.2511 -0...

4년 초과 전 | 0

| 수락됨

답변 있음
How to open a .p file in matlab ?
You cannot "open" a P-file in a meaningful way. Modifications are not possible. If you want to change the code of a P-coded fun...

4년 초과 전 | 2

답변 있음
Check if a script has been run during this session
Create your own function: function myActivate persistent called if isempty(called) activate(); caslled = true; end...

4년 초과 전 | 1

답변 있음
Set Path's "Add with Subfolders" functionality
Create your own copy of genpath as mygenpath and insert e.g.: ... if ~strcmp( dirname,'.') && ... ~strcm...

4년 초과 전 | 0

| 수락됨

답변 있음
Accessing Subfloders of Subfolders in MATLAB
BaseFolder = 'D:\Your\BaseFolder'; FileList = dir(fullfile(BaseFolder, '**', '*.xml')); for k = 1:numel(FileList) File =...

4년 초과 전 | 0

| 수락됨

문제를 풀었습니다


Calculate cosine without cos(x)
Solve cos(x). The use of the function cos() and sin() is not allowed.

4년 초과 전

답변 있음
How can I use the same script for multiple different matrix arrays at once?
% Move the set of variables to fields of a struct: NameList = sprintfc('Y%02d', 0:25); backcd= cd; cd(tempdir); save('dummy....

4년 초과 전 | 0

답변 있음
How to draw a number of colors from custom colormap?
YourMap = rand(256, 3); % 14 color which exist in the original map: Map14 = YourMap(round(linspace(1, 256, 14)), :); % ...

4년 초과 전 | 0

| 수락됨

답변 있음
Import STL file and convert to Matrix
What about using Matlab's STL import? https://www.mathworks.com/help/pde/ug/stl-file-import.html

4년 초과 전 | 0

답변 있음
How to speed up saving data to .txt file?
fopen, fprintf or even better fwrite is much faster than the very smart writematrix. Appending requires to open the file and sea...

4년 초과 전 | 0

| 수락됨

답변 있음
Are Matlab Apps backwards compatible with previous versions
No, the apps are not backward compatible. The users of the apps do need all functions, which are needed by the apps.

4년 초과 전 | 0

| 수락됨

답변 있음
Applying a single function to many files in one folder.
See: FAQ: How to process a sequence of files FolderIn = 'D:\Your\Folder'; FolderOut = 'D:\Your\B' FileList = dir(fullfile(F...

4년 초과 전 | 0

답변 있음
how to remove the error "Dimensions of matrices being concatenated are not consistent."?
I guess, the error occurs in this line: nsegName= ["L5S1","L3L4","T12L1","T8T9","C7T1","C1Head","RT4Shoulder","RShoulder","RElb...

4년 초과 전 | 0

| 수락됨

답변 있음
Is it possible to create all possible swaps/permutations within matrix?
A = reshape(1:9, 3, 3); p = perms(1:9); B = zeros(3, 3, size(p, 1)); for k = 1:size(p, 1) B(:, :, k) = reshape(A(p(k, :)),...

4년 초과 전 | 0

| 수락됨

답변 있음
Programmatically adjusting editor fontsize does not work
An easier version to set the desktop and editor font immediately: s = settings; % Set temporarily until next start of Matlab...

4년 초과 전 | 0

질문


How to access recent comments in the FileExchange?
I cannot find an efficient way to check, if my FileExchange submissions got new comments. In the old interface there was a list ...

4년 초과 전 | 답변 수: 1 | 1

1

답변

답변 있음
Matlab JIT engine nested loops data type
This is a good question. Matlab's JIT was partially documented in Matlab 6.5 (2001), but afterwards MathWorks avoided to publish...

4년 초과 전 | 2

| 수락됨

답변 있음
Help for setting the formatSpec
fprintf(fid,'%d %d %d\n', E); It is much faster to open the file once only: fid = fopen('Result.txt','a'); for k ...

4년 초과 전 | 0

| 수락됨

답변 있음
Array indices must be positive integers or logical values
I looks like this is a script. Then is shares the workspace variables with its caller. I guess, that you have created an array c...

4년 초과 전 | 1

더 보기