回答済み
Comparing input character and a String
Of course a(1) and a1 are two completely different things. It is not clear, what the contents of b1 is, but maybe you want: b1 ...

10日 前 | 1

| 採用済み

回答済み
How to speed up pairwise difference calculation between vectors under certain condition?
Instead of creating the huge index matrix abs(B-A(i))<=maxdif in each iteration, it is cheaper to search the lower and upper lim...

11日 前 | 0

| 採用済み

回答済み
I have 30x30 matrix and need to extrapolate lower triangle numbers
x = rand(5, 5); y = x(tril(true(size(x)))) What is the reason to avoid tril? Maybe: s = size(x); y = x((1:s(1)).' >= (1:s2)...

12日 前 | 1

回答済み
Unable to perform assignment because left and right sides have different number of elements
range(k) = [range(k), [data(i)]]; This cannot work, because range(k) is a scalar, but [range(k), [data(i)]] has 2 elements. By...

13日 前 | 0

回答済み
Reading a binary data file
fid = fopen('file.dat','r'); if fid <0 error('error opening file %s\n file.dat') end Program_label = fread(fid, [1 4...

13日 前 | 0

回答済み
Strange behavior of the editor in the forum
5 months later: Since about a week, at about every 5th or 8th time pressing Ctrl-E my Firefox decides to switch to the first ta...

13日 前 | 1

回答済み
How do I post a picture with my question
The question of how to embed a picture was answered already. Let me encourage all users to really use this feature, which is muc...

13日 前 | 1

| 採用済み

回答済み
How can i define variables in gui?
It depends on what "use "audiofile" in math operators" mean. After your code, audiofile is a variable, which contains the signal...

13日 前 | 0

| 採用済み

回答済み
How do I add a column to a cell array based on existing values in another column?
Only a beginner so forgive me for the basic question... but I have a cell array (x) of dimensions 1310x2. Column 1 is a unique i...

14日 前 | 2

回答済み
I want to store all the outputs in a single matrix and also i want to select all the combination for which c has minimum and maximum value.
result = zeros(5 * 4 * 20, 3); % Pre-allocate with maximum size count = 0; for a = 1:5 for b = 5:8 for c = 1:2...

14日 前 | 0

回答済み
How to multiplay matrices in different dimensions?
Perhaps: a = rand(2,2,3); b = [2, 2; 4, 4] % Elementwise - auto-expanding since R2016b: r = a .* b % Matrix multiplicat...

14日 前 | 1

| 採用済み

回答済み
Reading a txt file
S = fileread('filename'); C = strsplit(S, char(10)); C(strncmp(C, '$'), 1) = []; C(strncmp(C, '#'), 1) = []; C = strtok(C,...

14日 前 | 1

回答済み
How do I listen for when new axes are added to a figure?
What about: figure('DefaultAxesCreateFcn', 'disp(''hello'')'); subplot(1,2,1) subplot(1,2,2) To my surprise this shows 4 h...

14日 前 | 0

| 採用済み

回答済み
Why does this code output all values as 1?
elseif r1<=r(i)<=r2 This will not do, what you expect. Matlab processes the expression from left to right. The first part is: ...

14日 前 | 0

| 採用済み

回答済み
Copy the values of multiple fields in a structure to another structure at once
Maybe you mean: A.SM = []; p = repmat(A, 3, 1); B.SM = 1:5; p2 = repmat(B, 3, 1); [p.SM] = deal(p2.SM) Or with a lo...

14日 前 | 0

回答済み
Why is my modified path not saved in MATLAB?
It is safer to work without admin privileges to avoid an accidental modification of Matlab's toolbox functions. A drawback is, t...

14日 前 | 0

回答済み
Very slow loop trying to find any intersection
A simplified version to get the overview: dy = jaccard_dyadic; in = assignee_inventors; n = find(dy(:,1) == 0, 1, 'first') -...

15日 前 | 1

回答済み
my scripts won't update.
Are you sure that you edit the function which you run? Or do you have different versions of the function in different folders, a...

15日 前 | 1

| 採用済み

回答済み
Most efficient method to search through file names?
Folder = 'D:\Your\Folder'; FileList = dir(fullfile(Folder, '*.*')); NameList = {FileList.name}; % NameList = {'SSSTTTT0617'...

15日 前 | 2

回答済み
Set the color of the axes per default to black (instead of dark gray)?
I'd try it with: set(groot, 'DefaultAxesXColor', [0,0,0], ... 'DefaultAxesYColor', [0,0,0], ... 'Defaul...

15日 前 | 2

回答済み
How can I vectorize two nested loops with different dimensions?
The first loop looks strange, because the body does not depend on the loop counter i. Currently this should produce the same out...

15日 前 | 0

回答済み
duplicated result in for loop
The body of the loop does not depend on the loop counter lol. Therefore you must get the same value for each iteration. A bold ...

16日 前 | 0

| 採用済み

回答済み
print on the bottom line
You have 2 for i loops. Omit the inner one, because it overwrite all formerly existing values and repeats them 5 times. h = zer...

16日 前 | 0

| 採用済み

回答済み
how to create loops to automatically select next bits??
a = randi([0,1], 1, 80); for k = 1:16:80 b = a(k:k+15); ... end Or: aa = reshape(a, 16, 5); for k = 1:5 b = ...

16日 前 | 0

回答済み
"insfilter" inbuilt function error in Matlab 2018b
Use the local documentation of your Matlab installation to find out, which features are available. Using examples from another M...

16日 前 | 0

| 採用済み

回答済み
Problem of using "assignin" during figure callbacks
Exactly: Callbacks are called from the base workspace. "how could I get a output after the figure deleted in the subfunction wo...

16日 前 | 0

回答済み
How can I plot multiple lines with a slightly different shade of the same color?
startColor = [0.5, 0.5, 0.5]; for ii = 1:20 plot(time, freqlist{ii}, 'Color', startColor + (ii-1) / 40); hold on; en...

16日 前 | 0

| 採用済み

回答済み
how to implement structfun using 2 variables
This seems to be much easier: field = 'value1'; output1 = S.(field).x output1 = S1.(field).x structfun iterates over the f...

16日 前 | 1

回答済み
Why doesn't atan2 (u,v) give me the right angle of two simple vectors?
Of course this code replies 0. If one of the vectors is the Null vector, there cannot be an angle different from 0. So the only...

16日 前 | 0

回答済み
Invalid MEX-file: The specified module could not be found. For PolygonClip.mexw64
The DependencyWalker sounds like the best option to solve the problem. Of course you get the same dependencies for the same file...

16日 前 | 0

Load more