Respondida
how to write the randn' s code with just using rand and CLT
Since you don't actually want to use the CLT, then <https://en.wikipedia.org/wiki/Inverse_transform_sampling inverse sampling> i...

más de 8 años hace | 1

Respondida
How to make a table with multiple variables?
You've only created two vectors, not matrices. You're basically trying to divide a 1-by-5 by a 1-by-7 which doesnt work. What ...

más de 8 años hace | 0

Respondida
How to initialize a row vector with value zero of size 1xn?
Look up the documentation for the |zeros| function, which you are using: A = zeros(1,n);

más de 8 años hace | 2

Respondida
Plotting a mean line on a graph
%set up x = 1:0.1:10; r = sin(x); t = 1:91; x = mod(t,2) == 0; m_x = mean(r(x)); m_x2 = mean(-r(~x)); % plo...

más de 8 años hace | 0

Respondida
minimize integral function for a parameter
I think you can do something like this. Make a file with your integral that takes in |k|: function [ F ] = int_fun(k) ...

más de 8 años hace | 0

Respondida
Plotting an equation at different X
You should look up the |plot| function: incr = 0.1; x = [1:incr:20]; y = (1-x).^-1 plot(x,y)

más de 8 años hace | 0

Respondida
How can I create it?
Try this A = 2*cos(0.4.*pi.*(repmat([1:5]',1,5) - repmat([1:5],5,1)));

más de 8 años hace | 0

Pregunta

MCC in Matlab 2014b on Windows 10
This is a slightly esoteric question, but for some technical reasons I'm looking to use the Matlab runtime library compiler (mcc...

más de 8 años hace | 1 respuesta | 0

1

respuesta

Respondida
Function evaluation in each iteration of pattern search exceeding 2* (number of optimization variable)
You have |'SearchMethod'| enabled. This is an optional step which performs a search prior to the polling, resulting in the larg...

más de 8 años hace | 1

Respondida
Added Variable Plot: Adjusted whole model x-axis range
The added variable plot is little bit complicated; basically, because you have a multi-variable regression, it is trying to give...

más de 8 años hace | 3

Respondida
Integral of complicated function
There are a bunch of techniques you could use. Matlab has a built-in quadrature <http://www.mathworks.com/help/matlab/ref/integ...

más de 8 años hace | 0

Respondida
how to automatically open files and do the commands
You'll have to program this, but it's pretty straightforward. cd 'C:\Users\etc' %your file path with all the files. c = st...

más de 8 años hace | 0

Respondida
Adding a legend manually for a plot generated by a loop
I think the issue is that you don't want to generate the plot like that; it's slow and makes it hard to label. Check out this s...

más de 8 años hace | 1

Respondida
How to avoid this warning?
You've created a function named |plot| which has the same name as another function already in Matlab. To fix this, simply ren...

más de 8 años hace | 0

Respondida
How to save the variables inside for loop
The easiest way to probably to just use a <http://www.mathworks.com/help/matlab/ref/cell.html cell array>. Es = cell(100,1...

más de 8 años hace | 3

Respondida
Plotting 1MHz sine wave
Just change this line: t = 0:1/N:S; to this t = 0:(1/N)*S:S; The issue was that you are telling Matlab to create...

más de 8 años hace | 0

Respondida
separate column into several using descriptive variable
You want the <http://www.mathworks.com/help/matlab/ref/discretize.html discretize> function: x = 100*rand(1000,1); %your dat...

más de 8 años hace | 0

Respondida
Putting spacing between strings
You can do this by sending them to strings then concatenating them: A = 1; B = 8; C= 9; space = ' '; str ...

más de 8 años hace | 1

Respondida
Not enough input arguments for read an immage
Check out the <http://www.mathworks.com/help/images/ref/im2bw.html documentation>. The function |im2bw| needs two arguments: ...

más de 8 años hace | 0

Respondida
Undefined function 'mtimes' for input arguments of type 'cell'.?
This expression: sigma=[{0.307*(c_n)^2}*{(2*3.1416/lamda)^1.17}*{L^(1.833)}]-[{0.742*(c_n)^2}*{(2*23.1416/lamda)^0.17}*{(L^...

más de 8 años hace | 1

Respondida
How expand a matrix?
This should work A = [1 5 8 12 7 5 2 1]; floors = floor(A./3); C = cumsum(3.*ones(max(floors)+1,length(A)),1) A_p = re...

más de 8 años hace | 0

Respondida
How can a plot from an "if" inside of a while loop?
Try this: N=input('The total number of particles in the system is:'); %The total number of particls in the system n...

más de 8 años hace | 0

Respondida
determining indices of double type cells in a cell array of char and double type cells
See if this solves your problem c = {'cat',1,'bird',22,'elephant',3}; %an example of data in the format you have ind = fin...

más de 8 años hace | 1

Respondida
Genetic Algorithm fitness function for failing parameters
I think you probably want an <http://www.mathworks.com/help/gads/genetic-algorithm-options.html output function>. Basically...

más de 8 años hace | 1

Respondida
Solve non linear equations system
You need to do a couple of steps. First, make a function which returns the equation you want optimized: function [F] = fun...

más de 8 años hace | 0

Respondida
Remove help message from quadprog() function
You can call it like this: options = optimoptions('Display','off'); x = quadprog(H,f,A,b,Aeq,beq,lb,ub,x0,options); T...

más de 8 años hace | 1

Respondida
How can I add noise to linear graph
You never added the random noise to your dataset: sample = 100; x = linspace(-5,5); y= 1.6 * x +6; r = rand...

más de 8 años hace | 1

Respondida
How can I make all the variables in an array 0 after the first time 0 occurs in the array
Generate your |x| as normal, with the many 1's afterwards then call: x = [1,1,1,1,1,0,0,1,1,0,0,0]; %generate x x(find(x =...

más de 8 años hace | 0

Respondida
Index exceeds matrix dimensions
Your problem is this: bigDATA = nan(16, 100000); This is a 16x100,000 matrix of NaNs. ii_array = [198 139 81 80 84 2...

más de 8 años hace | 0

Respondida
How can I plot discrete x-axis values?
Try this x = [1,2,3,5,7,10]; %your bins y = rand(1,6); %your data numbins = size(x,2); x1 = [1:numbins]; bar(x1,y) ...

más de 8 años hace | 2