Risposto
Hello, I am trying to fit some data points with an exponential equation.
>> X = sort(rand(1,10)*30); % Say this is our x data. >> Y = 14*exp(3*X); % Say this is _unknown_ equation. >> pp = po...

quasi 14 anni fa | 0

Risposto
Convert (x,y) data into a function y => f(x)
You could use POLYFIT, or the curve fitting toolbox or a simple interpolation. >> x = 0:.25:5; >> y = x.^2; >> f = ...

quasi 14 anni fa | 1

| accettato

Risposto
regexprep - may the replacement string contain a variable?
Does this work? regexprep(str, '(xx\(i,)BE(\))', ['$1',q,'$2'] )

quasi 14 anni fa | 0

| accettato

Risposto
How do I write a script for a GUI.m file that allows me to press a button, choose a (*.csv) file and then copy this (*.csv) file to the current folder so it can be used for an existing simulation?
You need to make complete pathnames. One way to do it is to concatenate the output from UIGETFILE and also to concatenate the d...

quasi 14 anni fa | 0

| accettato

Risposto
Using "find" for finding decimal values
MiauMiau, the numbers you are looking for are obviously different from the short format you see. Do this: [~,idx] = min(...

quasi 14 anni fa | 1

| accettato

Risposto
How to add a timer
Here is a simple example. You should be able to adapt the concepts to your GUI or whatever. function [] = gui_timer() ...

quasi 14 anni fa | 0

Risposto
Changing the colour of a plot
load Data S = surf(x1, y1, z1); % Original to compare figure S2 = surf(x1, y1, z1); set(S2,'facecolor','interp','C...

quasi 14 anni fa | 0

Risposto
How to do set subtraction
a = 1:3; b = 2:5; c = setdiff(b,a)

quasi 14 anni fa | 4

| accettato

Risposto
How to vectorize a find
The last statement you show _is_ vectorized, so the question is ill-posed. I think what you are asking for is a way to speed up...

quasi 14 anni fa | 2

| accettato

Domanda


Where is a list of eventtypes for listeners?
_Usually_ I think MATLAB has excellent documentation, but there are occasions when I have to pull my hair out looking for someth...

quasi 14 anni fa | 2 risposte | 6

2

risposte

Risposto
How to constantly update a plot off of a slider being pulled
Yes. function [] = slider_plot() % Plot different plots according to slider location. S.fh = figure('units','...

quasi 14 anni fa | 0

Risposto
If , while with or
Did you look at the documentation? doc while In the documentation are examples. a = 1; b = 10; c = 20; d...

quasi 14 anni fa | 1

Risposto
Does logical indexing have a direct inverse?
Simple example: A = randperm(4); X = [0 1 0 1] B = A(X~=0) clear A Now _just look at_ X and B. By looking at j...

quasi 14 anni fa | 0

Risposto
How do I plot specific values from a matrix
idx = A(:,4)==3.7 & A(:,2)==1.2; plot(A(idx,1),A(idx,5)) Beware floating point issues!

quasi 14 anni fa | 1

Risposto
Correction function for graph
Use the SURF function to make a surface. doc surf

quasi 14 anni fa | 0

Risposto
UICONTEXTMENU will not appear on GUI
You need to set the uicontextmenu property, not assign a parent. S.fh = figure; cmenu = uicontextmenu; bgmenu = uim...

quasi 14 anni fa | 0

| accettato

Risposto
Compare two vectors for similarity
What is the criteria for 'almost similar' in your application? 90% same exact values? 90% of the values in one vector within 9...

quasi 14 anni fa | 0

| accettato

Risposto
For Loop runs too many times
I am confused about your question. You say you want to have C be a 2-by-3-by-4 array at the end of the loop, correct? That is ...

quasi 14 anni fa | 1

Risposto
Reference to non-existent field 'aD42'? Please help.
Use this line: solaD = solve(eqaDx,eqaDy,ep5z,aD42) Instead of the one you use for solaD. The problem is you have three...

quasi 14 anni fa | 0

| accettato

Risposto
Product of probabilities by group
Here is another method. This might work best if you have groups in increments of one because it uses the group number as the in...

quasi 14 anni fa | 1

| accettato

Risposto
Predefined variables k, z? Ans Help
k is a integer constant: Any integer k gives another solution. This is common with periodic functions. z is probably any comp...

quasi 14 anni fa | 0

Risposto
GUI differences among different users
Set the renderer of the GUI figure to painters or zbuffers and try again.

quasi 14 anni fa | 0

Risposto
Gamma function in MATLAB
syms s y I = int(s^(1/40)*exp(-(y-5)^(2)/(2*s^2)),s)

quasi 14 anni fa | 0

Risposto
How does one add multiple objects at random postions?
Add 5 of them: for ii = 1:5 mge_add_object('name','bear1','type','obstacle','pos', [randi(5),rand...

quasi 14 anni fa | 0

Risposto
Problem with datestr e datenum
>> data_even = {' 31/10/2012' ' 31/10/2012' ' 01/11/2012' ' 01/11/201...

quasi 14 anni fa | 0

| accettato

Risposto
In a MatLab plot, when is 'box on' the default, and when is it not?
I see you were not just using the PLOT function. The STAIRS function sets the box to on (line 99 in stairs.m). Thus as I s...

quasi 14 anni fa | 0

Risposto
Select a radiobutton.Calculate derivation or integration.
If you put the code in SelectionChangeFcn, then the integral or derivative will be computed as soon as the user changes radio bu...

quasi 14 anni fa | 1

| accettato

Risposto
how can i determine whether a matrix of any size is sorted or not (by rows and by columns)?
See the help for the ISSORTED function. help issorted

quasi 14 anni fa | 0

Risposto
Need help with edit box in matlab gui
n = str2double(get(handles.edit2,'String'));

quasi 14 anni fa | 0

| accettato

Risposto
Vectorize sum of discount rates
R = 5; cumsum(R.^(0:4))

quasi 14 anni fa | 0

| accettato

Carica altro