Answered
How to loop half matrix
for i = 2:nhx-1 for j = 2:(nhy + 1) / 2 Unew(i, j) = ... Unew(i, nhy - j + 1) = Unew(i, j); end end...

5 years ago | 0

| accepted

Answered
Integration over discrete data - don't know if trapz works here
Using trapz check input sizes and cares for matrices also. But if x and y are vectors, this can be done manually also. The trape...

5 years ago | 0

Answered
How to calculate ode45 of system of equations with particular initial conditions?
This looks trivial actually. Your initial values are: y0 = [5, 12] It is not required, that the initial time is 0. You can sta...

5 years ago | 0

| accepted

Answered
Running out of memory using imfuse repeatedly
"Out of memory" means, that your RAM is exhausted. The efficient solution is to install more RAM and to care for freeing as much...

5 years ago | 1

Answered
about palindrome number check
For numbers up to 2^53 the type double represents the digits exactly. This is 9-0e15. See flintmax. Your example n=1.7653692772...

5 years ago | 0

| accepted

Answered
Moving Data Between Apps and Separate Scripts?
Scripts are the wrong approach to transmit or receive inputs and outputs. The good programming practice is to start a GUI and l...

5 years ago | 0

Answered
help me --> Taylor series cos(x)
Please read the getting started chapters of the documentation and see Matlab's Onramp tutorial. Then split the question into pa...

5 years ago | 0

| accepted

Answered
Why can't complex integer arithmetic be done?
What about converting the complex int16 value to a single? a = int16(complex(2,3)) b = single(4 + 5i) c = single(a) * b

5 years ago | 0

Answered
Integration of a function which has limits in terms of parameters
syms t L rho m L n T k G v N(t) = (T*L/2)*(n*pi/L)^2+k*sin(n*pi*v*t/L); D(t) = (rho*L/2+m*(sin(n*pi*v*t/L))^2); alpha(t) ...

5 years ago | 0

| accepted

Answered
How to multiply a matrix to another cell matrix
Create a simple loop: A = rand(3, 3); for iC = 1:numel(C) % Where C is your cell C{iC} = A * C{iC}; end The approach wi...

5 years ago | 2

Answered
How to make three dimension matrix indexed sum return summation across the third dimension
datax = rand(3,3,5); cr1 = rand(3,3,5) > 0.5; cr2 = rand(3,3,5) > 0.5; ignore = (~cr1 | cr2); result = sum(datax .* i...

5 years ago | 0

| accepted

Answered
Why is histcount ignoring one of the edge values in my matrix?
I still have the impression, thet histcounts works less intuitive than the older hist. Remember, that the rightmost edge is hand...

5 years ago | 0

Answered
insert text in for loop operation
The question is not clear yet. Where should ' t = 0 s' appear? As title of an axes? for i = 1:200 %% image processing ...

5 years ago | 1

Answered
Change File Permission of File Created on a Unix System
Does your Windows account has write permissions in the folder? Which error message do you see in which program? Maybe the file ...

5 years ago | 0

Answered
Malwarebytes thinks these Matlab files are malware
The hash values are correct. This means, that the virus scanner produces a false alarm. You can determine this also by sending t...

5 years ago | 1

| accepted

Answered
design a room with small windows and furniture in it
The question is too general to be answered. How do you want to create the coordinates needed for the furniture? You cannot expec...

5 years ago | 0

| accepted

Answered
All possible combination based on 2^n but with 1 and -1
dec2bin creates a CHAR vector, while -'0' converts it to a double again. This indirection costs some time. The direct approach: ...

5 years ago | 0

Answered
Transparency violation error. Using 'eval' in a 'parfor' loop
Some general hints: load() without catching its output to a variable creates variables dynamically in the workspace. This imped...

5 years ago | 3

| accepted

Answered
Matrix multiplication to get covariance matrix
No, there is no chance for a significant speedup or vectorization, because the result of the former iteration is the input of th...

5 years ago | 0

Answered
Run the same script for multiple folders
See: FAQ: How to access a sequence of files FolderList = dir('C:\Your\BaseFolder\'): FolderList = FolderList([FolderList.isdir...

5 years ago | 0

Answered
How to create a 7*9 black and white image by using 0 and 1?
T = [0, 0, 0, 0, 0, 0, 0, 0, 0; ... 0, 1, 1, 1, 0, 1, 1, 1, 0; ... 0, 0, 1, 0, 0, 1, 0, 1, 0; ... 0, 0, 1, 0, ...

5 years ago | 1

Answered
How to perfrom indexing on nested cell array ?
Are you aware that cellfun looks really nice, but that the code runs faster with loops? In your case you see, that a simple loo...

5 years ago | 1

| accepted

Answered
Using index to name variables
Do not create variables names dynamically. This would store information in the names, where it is hard to access. Use the values...

5 years ago | 0

| accepted

Answered
Need help for "error using -mex file"
The message means, that the subfolder "gsl/" cannot be found. Then provide its base folder by the -I parameter. See: https://www...

5 years ago | 0

| accepted

Answered
Filter function in MATLAB
Did you read the documentation already? doc filter doc filtfilt filter() introduces a delay between input and output signals,...

5 years ago | 0

Answered
different reactions to right/left click
Comparing char vectors by == fails, if the number of characters is not equal. '123' == 'abc' % Working '1234' == '0' % W...

5 years ago | 0

| accepted

Answered
How do I fix the "A METHODS block or END might be missing before the function definition. This might be causing additional error messages." issue.
The conditions are not recognized in the "elseif" commands. If you really want to move them to the next line, insert the line co...

5 years ago | 1

Answered
Random line segments confined in a box
figure; axes('XLim', [-0.1, 1.1], 'YLim', [-0.1, 1.1]); nLine = 100; Coor = [0, 1, 1, 0, 0; ... 0, 0, 1, 1, 0]; for...

5 years ago | 2

| accepted

Answered
while loop in matlab
What's wrong with while true in Matlab?

5 years ago | 2

| accepted

Answered
How to save data from edit text using a push button in a GUI?
"With a pushbutton I want to close the GUI and save all the data from the edit boxes." Closing is easy: close(handle.figure1) ...

5 years ago | 1

| accepted

Load more