답변 있음
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...

대략 8년 전 | 1

| 수락됨

답변 있음
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 ...

대략 8년 전 | 0

| 수락됨

답변 있음
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);

대략 8년 전 | 2

| 수락됨

답변 있음
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...

대략 8년 전 | 0

답변 있음
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) ...

대략 8년 전 | 0

답변 있음
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)

대략 8년 전 | 0

| 수락됨

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

대략 8년 전 | 0

질문


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...

대략 8년 전 | 답변 수: 1 | 0

1

답변

답변 있음
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...

대략 8년 전 | 1

| 수락됨

답변 있음
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...

대략 8년 전 | 3

| 수락됨

답변 있음
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...

대략 8년 전 | 0

답변 있음
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...

대략 8년 전 | 0

| 수락됨

답변 있음
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...

대략 8년 전 | 1

| 수락됨

답변 있음
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...

대략 8년 전 | 0

답변 있음
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...

대략 8년 전 | 3

| 수락됨

답변 있음
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...

대략 8년 전 | 0

| 수락됨

답변 있음
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...

대략 8년 전 | 0

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

대략 8년 전 | 1

답변 있음
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: ...

대략 8년 전 | 0

| 수락됨

답변 있음
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^...

대략 8년 전 | 1

| 수락됨

답변 있음
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...

대략 8년 전 | 0

| 수락됨

답변 있음
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...

대략 8년 전 | 0

답변 있음
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...

대략 8년 전 | 1

| 수락됨

답변 있음
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...

대략 8년 전 | 1

| 수락됨

답변 있음
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...

대략 8년 전 | 0

| 수락됨

답변 있음
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...

대략 8년 전 | 1

답변 있음
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...

대략 8년 전 | 1

| 수락됨

답변 있음
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 =...

대략 8년 전 | 0

답변 있음
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...

대략 8년 전 | 0

답변 있음
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) ...

대략 8년 전 | 2

| 수락됨

더 보기