답변 있음
Plotting velocity of a piston
You probably wanted element-by-element division rather than array division... y=29.688*(sin(0+b))./(sin(90-b)); % Note ./ ...

13년 초과 전 | 1

| 수락됨

질문


Counting occurrences in order
I am wondering if anyone knows of a toolbox function that can perform this task quickly. I am not familiar with the Stats toolb...

13년 초과 전 | 답변 수: 2 | 4

2

답변

답변 있음
How to find duplicate values and what are they duplicates of?
There are many ways to do it. Here is another, just for fun: X = [2;5;1;2;2;0;0]; Y = arrayfun(@(x) {x find(X==x)},uniq...

13년 초과 전 | 0

답변 있음
Is there a limit to the number of characters used in a symbolic expression?
This works. str = ['y ', sprintf('+ %i',1:6000)]; syms y,y=1; subs(str) length(str) % >1300 *Fixed a typo.....

13년 초과 전 | 0

| 수락됨

답변 있음
Use eval statement to create Matrices with variables
Why are you using EVAL in the first place? This is usually *strongly* discouraged because it is *slow*, it is *prone to bugs* a...

13년 초과 전 | 3

답변 있음
replacing a string with another and vice versa
str = 'log(a(2))+a(3)*cosh(exp(bb(5)))'; % Initial string str = regexprep(str,'(bb)\((\d)\)|(a)\((\d)\)','$1_$2')

13년 초과 전 | 0

| 수락됨

답변 있음
Finding the roots of a function gotten from using ODE45
You can do it fairly painlessly. Here is an example of finding the zeros of the solution to the Van der Pol equation with mu=2:...

13년 초과 전 | 0

답변 있음
Calculating input matrix to Upper triangular matrix
A = magic(5); [m,n] = size(A) You might want to look at the TRIU function.

13년 초과 전 | 1

| 수락됨

답변 있음
How to assign a vector data to a structure array?
When you do this: y(1:length(x)).real = deal(x{:}) MATLAB only sees one output argument, but numel(x) input arguments. ...

13년 초과 전 | 0

답변 있음
I want to solve a sinus equation.
x = asin(b*sin(c)/d) Or, if you want MATLAB to do it: solve('b*sin(c)-d*sin(x)','x') You want x to be on [0 pi]? Y...

13년 초과 전 | 0

답변 있음
Question about strings on a matrix.
It looks like you have a cell array of strings. The single quotes only appear when the array displays; they are not part of the...

13년 초과 전 | 0

| 수락됨

답변 있음
excell logarithmic trend formula equivalent in matlab
x = 1:.1:10; y = 3 + 4.5 * log(x); polyfit(log(x),(y),1)

13년 초과 전 | 0

답변 있음
the code problem
Use the CONTINUE statement. k = 1; for ii = 1:10 for jj = 1:6 if(ii ==10 && jj == 3) con...

13년 초과 전 | 1

| 수락됨

답변 있음
Is there a way to obtain desired index without using 'find'?
ar=[102 243 453 768 897 243 653 23]; KEY = 1:length(ar); KEY(ar==243)

13년 초과 전 | 4

답변 있음
Issues with GUI not running properly
Yes, guide GUIs need to have the initialization code in the M-file run before the figure will work as you want. It is the natur...

13년 초과 전 | 1

답변 있음
detecting the existence of alphabetical elements
Perhaps best of all: str = 'adsf2342adsfwerreoj9f3f'; str2 = '23423'; flag = any(isletter(str)) flag = any(islet...

13년 초과 전 | 1

| 수락됨

답변 있음
structure indices in one line
V = values(urlAuthsMap,KH); % KH is the key you want. See key. From the link you showed above .... ;-)

13년 초과 전 | 0

| 수락됨

답변 있음
detecting the existence of alphabetical elements
str = 'adsf2342adsfwerreoj9f3f'; str2 = '23423'; flag = ~isempty(regexp(str,'[A-Za-z]')) flag = ~isempty(regexp(str2,...

13년 초과 전 | 0

답변 있음
Gui interface code question.
What you need to remember is that you are getting a string, not a number. If you want to use it as a number, you must convert f...

13년 초과 전 | 1

| 수락됨

답변 있음
How can I change the fontface of a text within a plot
get(gca,'fontname') % shows you what you are using. set(gca,'fontname','times') % Set it to times

13년 초과 전 | 9

답변 있음
GUI Question: Is it possible to print a symbolic expression on a GUI I created?
Yes, simply use the CHAR function on the output. Then set the string property of the uicontrol to the return of the call to CHA...

13년 초과 전 | 2

| 수락됨

답변 있음
I have no idea how to do this
You were very close, actually. A couple of things. One is, Sum holds your sum, so don't treat it like a vector by indexing int...

13년 초과 전 | 0

| 수락됨

답변 있음
matlab does not simplify the expression?
syms x simplify((x^10)^(1/5),'IgnoreAnalyticConstraints',true)

13년 초과 전 | 0

답변 있음
Writing characters to empty matrix
You may want to use cell arrays. for ii = 30:-1:1 T{ii} = sprintf('abc_x_%i',ii); end Now look: T{25} Th...

13년 초과 전 | 0

| 수락됨

답변 있음
How do you convert an array into a square matrix?
Another: x = 1:10; % Original x = x(ones(1,length(x)),:) % indexing instead of repmatting.

13년 초과 전 | 0

답변 있음
Efficient allocation of random numbers(U(0,1)) into categories
How about the <http://www.mathworks.com/help/matlab/ref/histc.html HISTC> function? Also, in your code there is no reference ...

13년 초과 전 | 0

| 수락됨

답변 있음
Question about arrays to elements.
I think the question is a little unclear, so I will go in a circle: A = [2 3 4 5 6] % Start here A2 = str2double(sprin...

13년 초과 전 | 0

답변 있음
Plot curves with different colors inside the for loop and calculation of integral with trapz
Use: hold all instead of: hold on And don't tell MATLAB to make every curve blue! You are telling MATLAB to mak...

13년 초과 전 | 0

| 수락됨

답변 있음
issue creating loop with matrix multiplication
What are you trying to save out of the loop? If you want to save the RotAll for each element of heading, pitch and roll, do: ...

13년 초과 전 | 0

답변 있음
getting error: Undefined function 'ge' for input arguments of type 'cell'.
target=0.2; vi=cellfun(@(x) x>=target,data(:,63)); data(vi,:); data3 = data(vi,:);

13년 초과 전 | 0

| 수락됨

더 보기