Beantwortet
how to store the conditional loop data
Your cleaned code: ut = rand(15, 1); uy = [0.84; 0.384; 0.784]; U_y = repmat(uy, 5, 1); for n = 1:15 if ut(n) > U_y(n...

mehr als 4 Jahre vor | 0

Beantwortet
Sorting a BigInteger array
How dod you create the array? Please post a short example. I seems that you are talking about a Java class, not a Matlab array. ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Matrix or vector operation faster?
The number of multiplications is the same in both versions, as far as I can see. So I'd expect both to need almost the same time...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Populate a 1000x1000 array with rows where a value is added every second, then third etc. column
You want an output of size 1000x1000: M = zeros(1000, 1000); You want a loop to go from 1 to 1000: for k = 1:1000 ... e...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
How can I import "curl" API in MATLAB using webread function?
What about using curl instead? This is included in Linux, MacOS and Windows also: system(['curl "https://www.sapsailing.com/sai...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
Finding allowed inputs to a function
Not in general. If a function uses the modern arguments block (since R2019b), this is possible. But many users are running older...

mehr als 4 Jahre vor | 0

Beantwortet
how to find sum different data for two different variables using loop in matlab
Maybe you want to do: "Multiply each element of vector a with all elements of vector b, devide by 100 and get the sum of all res...

mehr als 4 Jahre vor | 0

Beantwortet
Matrix is singular to working precision
Why do you assume, that something is wrong? The provided matrix is near to singular. In 1-D this would mean, that you try to div...

mehr als 4 Jahre vor | 0

Beantwortet
Solve the following simultaneous equations:
f1 = @(t,y) [-X/theta+(1+alpha)*y1(1-X)*Y^2+beta*y1(1-X)*Z^2; ... ... % ^ ^ * are ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
converting a matrix into a column vector using only while-end loop
This sounds like a homework question and you have shown, what you have tried so far. function A = func4(M) [m,n] = size(M); A...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Rename files after a certain string in the file itself appears
An explicit example would be useful: old name and new name. Maybe: files_csv = dir('*.csv'); for i = 1 : length(files_csv) ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
what's the code inside angle2dcm?
While I cannot find the code of angle2dcm , the equivalent function eul2rotm is useful for the explanation also. It produces the...

mehr als 4 Jahre vor | 0

Beantwortet
I am trying to make a new matrix for each iteration of a for loop
Q_bar = cell(1, length(theta)); for i = 1:length(theta) m = cosd(theta(i)); n = sind(theta(i)); T1 = [m^2, n^2, ...

mehr als 4 Jahre vor | 1

Beantwortet
While loop execution with multiple numeric and logical conditions
The code looks fine. Do you have a problem with it? It is a good programming practice to avoid repeated code. Maybe this is "cl...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
Failure in initial objective function evaluation. FSOLVE cannot continue.
You provide a handle to a script. This cannot work, because fsolve expects a function handle. Most likely you want: fsolve(@fcn...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Error using quiver The size of X must match the size of U or the number of columns of U.
x = -10:10; % No need for meshgrid since Matlab R2016b y = (-10:10).'; % simply use a row and a column vector k = 1; q...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
How does MATLAB REALLY pass arguments to functions?
See this blog about inplace operations: https://blogs.mathworks.com/loren/2007/03/22/in-place-operations-on-data/ And the docum...

mehr als 4 Jahre vor | 2

| akzeptiert

Beantwortet
How to register high resolution images of same modality?
If you image is stored in double format, it uses 10 GB of RAM. On a 64 GB machine this should work. So is installing more RAM an...

mehr als 4 Jahre vor | 1

Beantwortet
How to campare signals with different length?
It depends. You can compare two sine waves, if one has 80 and the other one 75 samples. But how do you define "similarity"? You...

mehr als 4 Jahre vor | 0

Beantwortet
How to I iterate a random selection among given elements without selecting the same element twice?
By the way, your code wouzld be much cleaner and shorter, if you use arrays instead of hiding indices in the field names: Define...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
What are the ideal computer specs for parallel computing with large data sets?
If the RAM is exhausted, the SSD or HDD is used as virtual RAM. This slows down the processing massively. You would see this by ...

mehr als 4 Jahre vor | 2

| akzeptiert

Beantwortet
Error when saving figure with linux command line
In batch mode, Matlab does not support interactive GUI elements. How do you save the figure as PNG? See: https://www.mathworks....

mehr als 4 Jahre vor | 0

Beantwortet
Unable to perform assignment because the left and right sides have a different number of elements.
Schwerp_X = first_Moment_X./en_density; Schwerpunkte_X(i) = Schwerp_X; first_Moment_X is a vector, so is Schwerp_X,...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
How do I vectorize my nested for loops for a convolution operation example?
Not a vectorization, but some tiny changes, which let the code tun 30% faster (at least in Matlab online - test this locally!): ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Count number of lines between strings in a text file.
S = readlines(filename); Index = find(startsWith(S, '#')); Len = diff(Index) - 1 % Length of the blocks

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Generating a Dictionary Function
function Word Data = fileread('YourDictionary.txt'); List = sort(lower(strsplit(Data, char(10)))); while 1 s = input('I...

mehr als 4 Jahre vor | 0

Beantwortet
Calculate the distance between points in a large data set
Do not create a pile of variables but a vector, which contains the distances: Distance = sqrt(diff(x).^2 + diff(y).^2);

mehr als 4 Jahre vor | 0

Beantwortet
Warning: Executing startup failed in matlabrc.
The message you show indicates, that it is a warning, not an error. Does Matlab stop with an error in addition? If it is a warn...

mehr als 4 Jahre vor | 0

Beantwortet
How to disable uicontrol 'mouseless' interaction
If you click on an uicontrol element, it gets the focus. Then following keyboard events are caught be the keyboard handling of t...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Reading multiple txt files and placing numerical data in a matrix
See: FAQ: How can I process a sequence of files? [filename, pathname] = uigetfile('*.txt','MultiSelect','on'); filename = cell...

mehr als 4 Jahre vor | 0

Mehr laden