Risposto
How do I map the data using interp1()?
I have no clue why you would want to do this, but the code below will treat the histogram as a lookup table. You need to convert...

circa 7 anni fa | 0

Risposto
Using throw error to validate string input
if any(~x) error(msg) end

circa 7 anni fa | 0

| accettato

Risposto
how to add to image ?
I would presume this means that you have an image where you add mean(X,'all') to the original. The loops are not needed in Matla...

circa 7 anni fa | 1

Risposto
x-axis value
You x-axis exponent has me believe that you already have the correct range and that your goal is to show nanoseconds instead of ...

circa 7 anni fa | 0

| accettato

Risposto
how can i change the xlim in bar?
You mean like this? set(gca,'XTick',ceil(1970:2.5:2005))

circa 7 anni fa | 0

| accettato

Risposto
Displaying values in static box for values in pop up menu !!
There is a difference between the Value property and the String property. Also, you're better off using switch (which will make ...

circa 7 anni fa | 0

| accettato

Risposto
How can i plot this kind of figure in Matlab ?
Looks like a bar plot and a line plot combined in one axis. Don't forget hold on when making this. For the second y axis you ca...

circa 7 anni fa | 0

Risposto
An easy problem for you,propably
Matlab doesn't work with double conditions, so you need to use a setup like the one below if you want to keep your code structur...

circa 7 anni fa | 1

Risposto
decimal place rounding off
Why not use the round function? You could use floor, ceil, or fix instead, but that would be cheating a bit. Anyway, you can u...

circa 7 anni fa | 0

Risposto
How to add brightness slider in matlab gui that would change the second image's brightness?
You should probably be using something like this: function pushbutton1_Callback(hObject, eventdata, handles) [filename,pathnam...

circa 7 anni fa | 0

| accettato

Risposto
Vectorizing a nasted loop
This should work: idx=reshape(1:(Chunks*Window),Window,Chunks); DataChunk=Raw.RAW(idx); TimeChunk=Raw.Time(idx); The output ...

circa 7 anni fa | 1

| accettato

Risposto
Dimensions of matrices being concatenated are not consistent.
Your x vector is 6x1, while all other vectors are 5x1. Removing one element from that vector lets the code run without error: x...

circa 7 anni fa | 0

| accettato

Risposto
How to add frame to image ?
Something like the code below should work. There are many ways to resize your image, below you'll find two examples. frame=imre...

circa 7 anni fa | 1

| accettato

Risposto
How to randomly swap 2 elements in an array?
I'm going to assume at least one of the swap elements must be an number, and that the swapped numbers are allowed to have the sa...

circa 7 anni fa | 0

| accettato

Risposto
Undefined function or variable
You don't define a, so it doesn't exist. But that is far from the only issue with your code. Also, why are you using j as a fun...

circa 7 anni fa | 1

Risposto
calculate mean using while and iteration?
So you want to calculate these values? xn(1)=mean(b(a>0.5 & a<1.5)); xn(2)=mean(b(a>1.5 & a<2.5)); xn(3)=mean(b(a>2.5 & a<3.5...

circa 7 anni fa | 0

| accettato

Risposto
Attempted to access x(2,1); index out of bounds because size(x)=[1,4].
The fsolve function requires a working function as input. Your function contains a few typos, and it assumes the input is a colu...

circa 7 anni fa | 0

Risposto
How can I interpolate medians in a box plot?
You can probably extract the median value from the object boxplot creates, but you can also use the median function to find the ...

circa 7 anni fa | 0

Risposto
Installing matlab 2019a 32 bit
Unfortunately, "x86-64" means '64 bit', not '32 or 64 bit'. Both your processor and OS must be 64 bit to have the 64 bit version...

circa 7 anni fa | 2

| accettato

Risposto
how can I test and display how many values in a vector are contained in a pre-determined interval
Trivial with ismember: idx=[168 190 173 147 147 110 169 57 174 122 159 174 104 132]; T=160:192; in_T=ismember(idx,T); numb...

circa 7 anni fa | 1

| accettato

Risposto
How to add distance lines between bar graphs in MATLAB?
I'm not aware of this functionality being implemented in the base Matlab. So if it is not in the FEX, you'll have to write it yo...

circa 7 anni fa | 0

Risposto
how to generate random numbers with constraints?
The reason for your infinite loop is that you need an average random value of 150, which is far from the expected value of 402.5...

circa 7 anni fa | 2

Risposto
User interface with GUI and callbacks working as interruption in a main function
You can use the callback of that second button to stop the continously looping timer function.

circa 7 anni fa | 0

| accettato

Risposto
Saving a montage image
There is a difference between an image and an image object. The latter is a graphics object that is shown in the axes. It does c...

circa 7 anni fa | 4

| accettato

Risposto
Replace Nan by a number in a cell array
You can use the isnan function: r = cell(sum(nL), numel(nL), numel(nW), max(nW(:))); for k = 1 : numel(nW) for m = 1 : nW...

circa 7 anni fa | 0

Risposto
MATLAB command window on High DPI screens
right-click on the title bar of your command window (you can open a fresh one by using windows+R and entering cmd) go to proper...

circa 7 anni fa | 1

| accettato

Risposto
How can I get the plot for a saved figure?
The line objects are probably in the Children property of your axes, which is itself a child of the figure (but so is the legend...

circa 7 anni fa | 2

| accettato

Risposto
Determine which cells contain elements of another cell
A few calls to cellfun, a regexp and ismember will do the trick: fileNames = [{'.'}, {'..'}, {'1.bin'}, {'1_Report.txt'}, {'2.b...

circa 7 anni fa | 1

Risposto
Add custom x and y axes (not relevant to the image)
The code below should help. You can specify tick labels that have nothing to do with the ticks themselves. %start out with a cl...

circa 7 anni fa | 0

| accettato

Risposto
spreadsheet and Matlab 2016
If I look in the store it is a separate product, similar to a toolbox.

circa 7 anni fa | 0

Carica altro