Answered

How do I read an image from a different folder into my .m file using Matlab in Ubuntu?

Possibly the file separator you use is wrong? In Unix systems you use "/" while in Windows you use "\". However, you write "dir(...

How do I read an image from a different folder into my .m file using Matlab in Ubuntu?

Possibly the file separator you use is wrong? In Unix systems you use "/" while in Windows you use "\". However, you write "dir(...

4 years ago | 0

Answered

How can I plot loglog(x,y) with experimental data including negative and less than one

_Why_ do you want a logarithmic plot of this data? Usually, when using loglog (or semilog) the point is that a change from, let'...

How can I plot loglog(x,y) with experimental data including negative and less than one

_Why_ do you want a logarithmic plot of this data? Usually, when using loglog (or semilog) the point is that a change from, let'...

4 years ago | 0

| accepted

Answered

Is it possible to delete "subplots"?

If you haven't already saved the handles when creating the axes, you can first get the handles with haxes=get(gcf,'children...

Is it possible to delete "subplots"?

If you haven't already saved the handles when creating the axes, you can first get the handles with haxes=get(gcf,'children...

4 years ago | 2

Answered

Check if push button has an image on it or not

You need to use get and isequal: if isequal(get(handles.pushbutton1,'cdata'),[]) || isequal(get(handles.pushbutton2,'c...

Check if push button has an image on it or not

You need to use get and isequal: if isequal(get(handles.pushbutton1,'cdata'),[]) || isequal(get(handles.pushbutton2,'c...

4 years ago | 0

| accepted

Answered

Problem executing if and elseif statements

You have conditions like 22.22>X(1,i)>11.11 What you actually mean, I guess, is 22.22>X(1,i) && X(1,i)>11.11| Le...

Problem executing if and elseif statements

You have conditions like 22.22>X(1,i)>11.11 What you actually mean, I guess, is 22.22>X(1,i) && X(1,i)>11.11| Le...

4 years ago | 1

| accepted

Answered

How to insert LaTeX equation into static text/plot in GUI?

I guess you mean a uicontrol of style "text" with "static text", right? The first part of your question: You set the String ...

How to insert LaTeX equation into static text/plot in GUI?

I guess you mean a uicontrol of style "text" with "static text", right? The first part of your question: You set the String ...

4 years ago | 1

Answered

if an array like [.002 1.1103 0.665 .002]. how can i get [a b c a]?

Does the output need to be ".002" or is "0.002" also fine? If there must not be the leading zero, what kind of array do you have...

if an array like [.002 1.1103 0.665 .002]. how can i get [a b c a]?

Does the output need to be ".002" or is "0.002" also fine? If there must not be the leading zero, what kind of array do you have...

4 years ago | 0

Answered

how to modify a simple program--question is 'start point not provide'

It's just a warning, no big deal. Different kinds of fit algorithm exist, some need boundaries (so, the parameters can be betwee...

how to modify a simple program--question is 'start point not provide'

It's just a warning, no big deal. Different kinds of fit algorithm exist, some need boundaries (so, the parameters can be betwee...

4 years ago | 0

Answered

Generating a 3D plot

I guess with "3D-plot" you mean a surface plot? So it would be like x=linspace(0,1,50); %I just choose random values here ...

Generating a 3D plot

I guess with "3D-plot" you mean a surface plot? So it would be like x=linspace(0,1,50); %I just choose random values here ...

4 years ago | 0

Answered

Polar Coordinates: filling the areas with RGB color matrix

You can use patches, exactly. Here is an example for the outer ring, I assume that it reaches from r=0.8 to r=1. phi=linspa...

Polar Coordinates: filling the areas with RGB color matrix

You can use patches, exactly. Here is an example for the outer ring, I assume that it reaches from r=0.8 to r=1. phi=linspa...

4 years ago | 0

Answered

Using Meshgrid for 3 variables

For simplicity, let's set a and L to [1 2 3] each, ok? And your function to get d is just summation. As your code snippet do...

Using Meshgrid for 3 variables

For simplicity, let's set a and L to [1 2 3] each, ok? And your function to get d is just summation. As your code snippet do...

4 years ago | 0

Answered

Adding the columns of matrix and concatenating them

Each week, there are about 5-10 questions with this respect. The simple answer is, "not this way". The only way is an extensive ...

Adding the columns of matrix and concatenating them

Each week, there are about 5-10 questions with this respect. The simple answer is, "not this way". The only way is an extensive ...

4 years ago | 1

Answered

how can jump and go to line

There is no jump keyword in Matlab. You can just check like N=input('enter the number :'); N1=find(XY(:,1)==N); %find t...

how can jump and go to line

There is no jump keyword in Matlab. You can just check like N=input('enter the number :'); N1=find(XY(:,1)==N); %find t...

4 years ago | 0

| accepted

Answered

How can I calculate fzero from values of matrices in cell array?

Dear Beáta, Check this line (same holds for the next two lines): mat(i,j)=cv_o{jj}; As you said, cv_o{jj} will retu...

How can I calculate fzero from values of matrices in cell array?

Dear Beáta, Check this line (same holds for the next two lines): mat(i,j)=cv_o{jj}; As you said, cv_o{jj} will retu...

4 years ago | 0

| accepted

Answered

Any Help with this question

It would be so much easier if you wouldn't post a screenshot but just the code as text. Then, somebody else could copy and possi...

Any Help with this question

It would be so much easier if you wouldn't post a screenshot but just the code as text. Then, somebody else could copy and possi...

4 years ago | 0

Answered

I want to read each number seperated by , from my text file using Matlab. The content of the text file are as below. How can i read....

Why not just str=fileread('test.txt'); %read file str=regexprep(str,'[^0-9 ]',''); %remove everything but digits a...

I want to read each number seperated by , from my text file using Matlab. The content of the text file are as below. How can i read....

Why not just str=fileread('test.txt'); %read file str=regexprep(str,'[^0-9 ]',''); %remove everything but digits a...

4 years ago | 0

| accepted

Answered

plot multiple equations in a for loop

Please, use the |{} Code| button above the field you're writing your question to make the post be readable. Also, you should...

plot multiple equations in a for loop

Please, use the |{} Code| button above the field you're writing your question to make the post be readable. Also, you should...

4 years ago | 0

| accepted

Answered

using find function for char

line='10 L1 L2 L5 C1 C2 P2 C5 S1 S2'; strfind(line,'L2') ans = 13

using find function for char

line='10 L1 L2 L5 C1 C2 P2 C5 S1 S2'; strfind(line,'L2') ans = 13

4 years ago | 0

Answered

how to store function [x] = input('blah')

You mean, like this? guess=inPut; Btw, your first while loop (the one outside showResults) is not necessary. You loop in...

how to store function [x] = input('blah')

You mean, like this? guess=inPut; Btw, your first while loop (the one outside showResults) is not necessary. You loop in...

4 years ago | 0

Answered

How to form a Single matrix from Multiple matrices by taking perticular element from each matrix.???

I guess this particular definition of A is just an example, right? If it's really about these specific values, the final result ...

How to form a Single matrix from Multiple matrices by taking perticular element from each matrix.???

I guess this particular definition of A is just an example, right? If it's really about these specific values, the final result ...

4 years ago | 0

| accepted

Answered

Adjusting if loop to calculate probability for each column of dynamic array

I cannot find a for loop in your code. Anyway, there's also no need for a loop, this can easily be vectorized. num_of_zero...

Adjusting if loop to calculate probability for each column of dynamic array

I cannot find a for loop in your code. Anyway, there's also no need for a loop, this can easily be vectorized. num_of_zero...

4 years ago | 0

| accepted

Answered

Coordinate system in matlab

Usually there's a way to map one system to another, e.g. to go from a spherical system to a Cartesian, you'll use some (a)tan() ...

Coordinate system in matlab

Usually there's a way to map one system to another, e.g. to go from a spherical system to a Cartesian, you'll use some (a)tan() ...

4 years ago | 0

Answered

Solving non linear equation system.

fsolve needs a function which has only one variable. Therefore, you need to change your definition to M=@(x)[sin(x(1))+x(2)-...

Solving non linear equation system.

fsolve needs a function which has only one variable. Therefore, you need to change your definition to M=@(x)[sin(x(1))+x(2)-...

4 years ago | 0

Answered

How can I import .dat file without rounding the values where in the .dat file ?

Matlab doesn't round-off automatically. You might mean the values shown in the command window. But that's only the displayed val...

How can I import .dat file without rounding the values where in the .dat file ?

Matlab doesn't round-off automatically. You might mean the values shown in the command window. But that's only the displayed val...

4 years ago | 0

Answered

Writing a Script for a Function

As this is a homework, I guess things like analytical solutions are not the key here. In principle, you can do this with ...

Writing a Script for a Function

As this is a homework, I guess things like analytical solutions are not the key here. In principle, you can do this with ...

4 years ago | 0

| accepted

Answered

How do fix errors like this - "The expression to the left of the equals sign is not a valid target for an assignment.". The code is given below which is showing the mentioned error when executed.

The error description is pretty clear, on the left hand side you have something you cannot assign a value to. The left hand side...

How do fix errors like this - "The expression to the left of the equals sign is not a valid target for an assignment.". The code is given below which is showing the mentioned error when executed.

The error description is pretty clear, on the left hand side you have something you cannot assign a value to. The left hand side...

4 years ago | 0

Answered

LOG vs LOG10 plot

loglog is to the base of 10 (just see the axis scale).

LOG vs LOG10 plot

loglog is to the base of 10 (just see the axis scale).

4 years ago | 0

| accepted

Answered

How to create moving average filter in tide data?

If data is the array with your values and t is date/time: plot(t, smooth(data));

How to create moving average filter in tide data?

If data is the array with your values and t is date/time: plot(t, smooth(data));

4 years ago | 0

| accepted

Answered

Generate new array with logarithmic spacing

I'm not sure what you want. You can get a logspaced array like this: Assume that x is your xdata and you want the log array to h...

Generate new array with logarithmic spacing

I'm not sure what you want. You can get a logspaced array like this: Assume that x is your xdata and you want the log array to h...

4 years ago | 0

| accepted