Babylonian algorithm - square root of a number
What is the problem - works for me: y = sqrtB([16 4 9]); function y=sqrtB(x) % It returns a row vector containing the...

etwa 2 Monate ago | 1

| accepted

how do I create Matraix with same elements for several rows
turbines = [25,35,45,55,65]; how_often = 10; No_of_turbines = repmat(turbines,how_often,1) to get it ten times: No_of_turbin...

etwa 2 Monate ago | 0

| accepted

Save lines from a text file
It is a bad idea to store the lines all in different variables - this point has been discussed here for many times... Use a tabl...

etwa 2 Monate ago | 1

| accepted

Failure in initial objective function evaluation. LSQNONLIN cannot continue.
The problem is that your DATA file is not complete - the sheet that should contain the data for N ist empty - therefore N is als...

etwa 2 Monate ago | 0

| accepted

how can i give output of a python file as input to a matlab matrix

etwa 2 Monate ago | 0

reading large text files into matrix
As already stated in the other question you asked with the same content, a possible way is: A = readcell('output1.txt'); B = s...

etwa 2 Monate ago | 0

read a matrix from a text file
A = readcell('output1.txt'); B = str2num(char(replace(split(string([A{:,1}]),']'),... {'00', '10', '01', '11', '['},{'0 0'...

etwa 2 Monate ago | 0

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 3-by-3.
You could check: https://de.mathworks.com/matlabcentral/fileexchange/69896-linalgsubstitute I used this function to build the ...

etwa 2 Monate ago | 0

Issuing a call to a function

etwa 2 Monate ago | 0

I face an error when apply bvp4c: Unable to solve the collocation equations -- a singular Jacobian encountered.
It appears to work by making 2 small changes in the code: init=bvpinit(linspace(0.001,0.9999,10),[0 0]); sol=bvp5c(@bvp_Q,@bvp...

etwa 2 Monate ago | 1

How to filter a data
You can do this if there is a pattern: X = [0.081,0.082,0.089,0.091,0.095,0.098,0.13,0.15,0.18,0.21,0.25,0.31]; x = [X(1:3:end...

etwa 2 Monate ago | 0

How can I sort a matrix elementwise ?
B = sort(reshape(A,[],1))

etwa 2 Monate ago | 1

Error: Error using load Unknown text on line number 1 of ASCII file cats.csv "Sex".

etwa 2 Monate ago | 0

| accepted

Locate any decimal value inside a matrix?
Why use an ineffficient loop instead of vectorized inbuilt functions? Try: x=[1 2.5 4;5 3 3.2;4 9 2] idx = find(mod(x,1)~=...

etwa 2 Monate ago | 0

Convert matrix A to S
S=[A(2,1:2); A(1,1:2); 9 10]

etwa 2 Monate ago | 0

Extract column from matrix
Do this A2 = A(:,3) but note that you did not code the matrix as you wrote: >> A = [6 2 3; 9 3 5; 4 4 7] A = 6 ...

etwa 2 Monate ago | 0

what is the problem in this function ?
Use: result = fmin4(a,b,c) instead of pressing the RUN button

etwa 2 Monate ago | 0

| accepted

problem in dealing Cell and array
% produce some data to play with r = 3; q = 4; k(1:5) = {rand(r,q)}; % size of k = 1 x 5 % This should do what you expect:...

etwa 2 Monate ago | 1

| accepted

I need help with this false position script
No idea what your problem is, code runs for me: format long fx=@(x)-12-(21*x)+(18*x^2)-(2.75*x^3) a =sprintf('%.8f', fp(f...

etwa 2 Monate ago | 0

Run a script multiple times and save outputs
Write a function or a second script which calls your script in a for loop and save the results in a new line of a result matrix ...

etwa 2 Monate ago | 0

| accepted

How can i reduce the powers of all plotted functions to 0
one approach using string arrays: number = exp(100) a = split(string(sprintf('%e',number)),"e+"); b = double("1e+" + stri...

etwa 2 Monate ago | 0

energy harvesting with game theory
The was you ask it: No. In general there are no tailored codes for very specific things like you want. You can browse <htt...

etwa 2 Monate ago | 0

Creating a sinusoidal graph
Note the frequency of your signals. Are 100 values really enough to display this frequency correctly? Hint: Think about somethi...

etwa 2 Monate ago | 0

Create a table in MatLab with specific data in different spreadsheets in one Excel File.

etwa 2 Monate ago | 1

| accepted

R2018a contained wlan example code, but none of it is in R2019b. What happened to all the wlan example code?
There is a bunch of examples here: <https://de.mathworks.com/help/wlan/examples.html>

etwa 2 Monate ago | 0

How to convert a matrix to a vector
M1=reshape(M.',[],1)

etwa 2 Monate ago | 0

| accepted

I don't know why ODE45 function does not count time. Runs forever.
Your code repeats calculations on constants that should be done only once for performance - but more important ist that your ode...

etwa 2 Monate ago | 3

How to find the arc length of a trajectory?
Maybe it helps if you know the center coordinates and the radius of your circle -after that you can calculate the angles and use...

etwa 2 Monate ago | 0