답변 있음
whats wrong with this function?
Which inputs are you using? If e.g. best_salt_1 is not one of the options of the first switch block, the output of [] is expecte...

대략 4년 전 | 0

답변 있음
My matlab is not recognizing HEXA values
Your observation is correct. Before version 2019b hexadecimal and binary values are not recognized by Matlab and a leading 0x or...

대략 4년 전 | 0

| 수락됨

답변 있음
facing problem in reshaping the column matrix please help
Maybe you mean: n = 3; E = zeros(n+1, 1); % Pre-allocate in wanted dimension instead of reshape ee = zeros(n+1, n+1, n+1); ...

대략 4년 전 | 1

답변 있음
how to calculate cauchy product in summation
The shown code cannot run. In the 1st iteration of the "for i" loop, the inner loop is not entered: "for p = 1:i-1". In the 2nd ...

대략 4년 전 | 0

답변 있음
How do you elegantly load dynamic variables into a cell array?
Avoid eval. Instead of eval(sprintf("out.%s.Data","A1")) this is faster, safer and nicer: out.('A1').Data Then the loop beco...

대략 4년 전 | 0

| 수락됨

답변 있음
find the location of a vector in a cell array and extract the last element of that vector
Why do you store the vectors in such a complicated format? Creating one [M x 3] matrix would help to create an easy solution: A...

대략 4년 전 | 1

| 수락됨

답변 있음
Is there a keyboard shortcut for deleting one character ahead of the cursor, instead of one character behind it?
Usually this is done by the delete key.

대략 4년 전 | 1

| 수락됨

답변 있음
Translate vector to a center point
At first simplify AB = [(A(:,1)-B(:,1)), (A(:,2)-B(:,2)), (A(:,3)-B(:,3))]; BC = [(C(:,1)-B(:,1)), (C(:,2)-B(:,2)), (C(:,3)-B(...

대략 4년 전 | 0

답변 있음
How to delete even Index from array and replace zero at the end MATLAB
"delete even index sample from the array and add zero at the end" Maybe: X = rand(10, 10); % Arbitrary test data ...

대략 4년 전 | 0

| 수락됨

답변 있음
How do I make a cell array of doubles with non-uniform dimensions into a matlab array? (substitution of blanks with NaN or Zero)
Another hint to save time: cellfun is less efficient than a loop: data = {'[700 900]';'[700 900 1050 800]';'[700]'}; data = re...

대략 4년 전 | 1

| 수락됨

답변 있음
Why using interp2 gives NaN
interp2() replies NaNs, if the interpolated points are outside the given set of points, so it is a "extrapolation". So stop the ...

대략 4년 전 | 0

| 수락됨

답변 있음
ismember or setdiff but with different number of columns
A = [8,6,7]; B = [1,6,9; 3,5,4; 7,0,2]; M = ismember(B, A) C = find(any(M, 2))

대략 4년 전 | 1

| 수락됨

답변 있음
Hello, I am trying to solve the ODE but I have an error I do not understand how to solve. Would appreciate some help. Thank you!
Omit the "@(x)" in: dxdt = @(x) [q - (thrust*sin(alpha+epsilon) + L)/(mass*u) + g/u*cos(theta-alpha); ... % ^^^^ ...

대략 4년 전 | 0

| 수락됨

답변 있음
efficient variable circshift on 3D matrix
In this code: s = size(A); a = reshape(A, [], s(3))'; b = reshape(B, [], 1); ub = unique(b); for i = 1:numel(ub) m ...

대략 4년 전 | 0

| 수락됨

답변 있음
Installed the 2007 teaching version of MATLAB, but the following window appears
The error message means, that the device for reading the installation data cannot access the file "mwinstall.dll". Now please me...

대략 4년 전 | 0

답변 있음
why is showing Inf and Nan value how to remove that
Your function is growing exponentially. It is the mathematically correct behaviour, that it reaches Inf. "Fixing" this would mea...

대략 4년 전 | 0

답변 있음
How to improve my inefficient code?
This is a first point to start from: load 'data' Calling load without catching the output creates variables dynamically. This ...

대략 4년 전 | 2

답변 있음
Draw a straight line on a gray image and calculate the sum of the gray values on the straight line
This is a job fpr improfile .

대략 4년 전 | 0

| 수락됨

답변 있음
Can Matlab read the most recent made file in the default folder?
A summary of the comments: d = dir('somefolder/*txt'); [~, index] = max([d.datenum]); youngestFile = fullfile(d(...

대략 4년 전 | 1

| 수락됨

답변 있음
Index exceeds the number of array elements. Index must not exceed 0.
This is strange: MaxEmDim = size(Portrait) *[0;1]; Nopoints = [size(xnew)*[1;0] size(xnew)*[1;0] size(xnew)*[1;0]] Use size(X...

대략 4년 전 | 0

답변 있음
How do i read 60 .txt files into matlab?
Some hints: Omit the clear all . It wastes time and has no benefit. It removes all loaded functions from the memory and relaodi...

대략 4년 전 | 0

답변 있음
Unable to load multiple mat files
This does not match: S = struct([]); for i=1:numel(theFiles) S{i} = ... You define S as a struct, but then you creat...

대략 4년 전 | 0

제출됨


strncmpr
Compare last N chars of strings or cell strings (fast C-Mex)

대략 4년 전 | 다운로드 수: 1 |

0.0 / 5

답변 있음
I want to implement all possible 2*2 or 3*3 or n*n matrices by using 0 or/and 1 as their elements.
n = 3; M = rem(uint8(floor((0:2^(n*n)-1) .* pow2(0:-1:1-n^2).')), 2); M = reshape(M, n, n, []); M(:, :, 1) M(:, :, 2) M(:, ...

대략 4년 전 | 1

| 수락됨

답변 있음
How do I add 0 after every value in a vektor
This works without a loop. v = [3,5,2,7]; Now append a 2nd row with zeros: v = [v; zeros(size(v))]; % Or equivalently: v(2,...

대략 4년 전 | 0

답변 있음
How to read xlsx file with displayed precision of decimals
The problem is not trivial. Notice that e.g. "3.50" can have the stored value "3.4999999999999999". This is smaller than 3.5, bu...

대략 4년 전 | 0

답변 있음
Multiplying two vectors to form a matrix
z = sqrt(x .^ 2 + y.' .^ 2) But, of course, this does not match "multiply them". If you want a multiplication: x .* y.' [ED...

대략 4년 전 | 0

| 수락됨

답변 있음
how to remove columns from a 3D array, considering user input
Either use square brackets for the input: b = input('Indices enclosed in square brackets: '); % Type in: [1,5,7] Or input a s...

대략 4년 전 | 0

| 수락됨

답변 있음
how to do a for cycle for cell arrays
And the next question concering indices hidden in the names of variables. Use an array instead. In your case, data2 is sufficie...

대략 4년 전 | 0

| 수락됨

답변 있음
how to use a for cycle with strings as variables
As soon as you do not hide indices in the names of variables, but use arrays instead, the code is trivial: for k = 1:10 writ...

대략 4년 전 | 0

| 수락됨

더 보기