Risposto
How to save an average voxel values from multiple ROIs in a dicom slice?
BW1 = createMask(e, I); Data=I(BW1); Now you can calculate the statistics you need. I would suggest using a struct array: % ...

oltre 6 anni fa | 1

| accettato

Risposto
Remove/Refresh all Fields
Yes, although you should consider changing your data structure. handles = struct;%will do what you ask You should store ...

oltre 6 anni fa | 0

| accettato

Risposto
Create a mask based on pixel values
IM = uint8(randi(255,100,80)); L= IM >=50 & IM <=125;

oltre 6 anni fa | 0

Risposto
How to calculate r squared from a given cos regression model
y_fit = a ∗ cos(5*x) err=y-y_fit; SSres=sum(err.^2); SStot=sum((y-mean(y)).^2); rsq=1-(SSres./SStot);

oltre 6 anni fa | 0

| accettato

Risposto
plot shifting while using histcounts
You are specifying the number of bins, not the exact bins. Then when you are plotting you don't specify the x-value. If you chan...

oltre 6 anni fa | 0

| accettato

Risposto
I have daily data from 1969 to 2018. I want to remove the rows corresponding to 29-02 day from the matrix. How should I proceed?
[num,txt]=xlsread('Sample.xlsx'); t=datetime(txt); L=day(t)==29 & month(t)==2; num(L,:)=[]; t(L,:)=[];

oltre 6 anni fa | 0

| accettato

Risposto
How to reset the pop-up menu value in GUI?
If you need something in your base workspace to be updated when you change things in your GUI, you could consider a programmatic...

oltre 6 anni fa | 0

Risposto
How to pass a table generated from a function back to app-designer?
Can't you do something like this? app.T1=Function1(app, app.Path, app.File.Value); Of course that would require you to change ...

oltre 6 anni fa | 0

| accettato

Risposto
Is ifft(fft(x).*fft(h)) faster or conv(x,h) ?
Why would a textbook say ifft(fft()) is faster? That doens't make sense. If that was the case, Mathworks would have implemented ...

oltre 6 anni fa | 0

Risposto
need help in creating a loop
You can use the for keyword to start a loop. x=input('Enter amount of data needed to be entered:'); for n=1:x y(n)=in...

oltre 6 anni fa | 0

| accettato

Risposto
Passing variables in GUI vs. assignin then evalin
To answer the question of how to do it with guidata: %this stores data to your figure: guidata(hObject,handles) %this ret...

oltre 6 anni fa | 0

| accettato

Risposto
Passing variables in matlab GUI
You should store your variable in the guidata struct. That way you can easily share it across different callback functions. I...

oltre 6 anni fa | 0

Risposto
Is there any way to adjust the appearance of the menu dialog box?
You can make your own from scratch.

oltre 6 anni fa | 0

Risposto
How to use slider in matlab for varying two values in graph?
You should create the plot and use the slider callback function to modify the underlying data. The code below should get you mo...

oltre 6 anni fa | 0

| accettato

Risposto
Filtering with non-zero initial conditions
See if the code below works for your purpose. totaltime=2;%in minutes samplerange=totaltime/0.5;%30 seconds/row data=randi(...

oltre 6 anni fa | 0

| accettato

Risposto
Filter a matrix of data
Just use logical indexing: N=100;data=randi(100,N,2)/2;%generate random data L=data(:,1)<25 & data(:,2)>30; newdata=data(L,...

oltre 6 anni fa | 3

| accettato

Risposto
Finding the ratio of numbers in an array
rois=data{1, i}(31:end,2)./data{1, i}(1:(end-30),2); In your current loop you are overwriting your result every iteration, ...

oltre 6 anni fa | 0

Risposto
Distance betwen 3d points
If you have the statistics toolbox you can use pdist2.

oltre 6 anni fa | 1

Risposto
relation between two variable
You can plot a 3D scatter plot with scatter3. To get your function you will need more points. You will need at least the same n...

oltre 6 anni fa | 1

Risposto
Help!!! How do I do loops to fill certain parts of the matrix?
I suspect it is easier to create a checkerboard pattern and replicate that to get enough pixels. It is also a good idea to tr...

oltre 6 anni fa | 0

Risposto
i would like to have the license key of my license
I can find my license number if I go to the my account page. Otherwise you will have to contact Mathworks support directly.

oltre 6 anni fa | 0

Risposto
where to save the function file to work?
You need to make sure your function can be found by Matlab by placing it on the path. The general advice is to have a folder wh...

oltre 6 anni fa | 0

Risposto
question to continue the code
As the documentation states, rmdir only works for empty folders. If you want to remove all files and folders inside that folder ...

oltre 6 anni fa | 0

| accettato

Risposto
Getting rid of duplicate values in pairwise matrix to obtain single vector?
The easiest is the pragmatic approach: get the counts with histcounts and divide that by 2. X=randn(100,1); [N,edges] = histco...

oltre 6 anni fa | 0

| accettato

Risposto
how do you find solutions of this marix equation using matlab 2019
Let's first do some algebra, and then solve it with a oneliner: %{ Ax = b A\Ax = A\b (A\A = 1) x = A\b %} A = [3.8 -7....

oltre 6 anni fa | 0

| accettato

Risposto
How can I fit this data?
Your model function contains some redundant terms that should be merged. Below you find the code to estimate your parameters and...

oltre 6 anni fa | 0

| accettato

Risposto
how to use buitin functions like fcm in gui?
A GUI in Matlab is nothing special. You need to have working code first, and then put that into a GUI. If you have trouble with ...

oltre 6 anni fa | 0

| accettato

Risposto
how to get an matrix as an output in a function
The mlint is giving you a hint: it wants you to put a semicolon to suppres output. Why would you have an output with the for loo...

oltre 6 anni fa | 2

| accettato

Risposto
class vs data type?
In general I would consider 'class' a superset of 'data type' and only include the core Matlab clases a list of data types, so t...

oltre 6 anni fa | 0

Risposto
Defining scatter plot with different 'markers' & 'colors'
This should be close to what you need: test = xlsread('HQ3.xlsx', 'A2:D223'); x=test(:,1); y=test(:,2); z=test(:,3); groups...

oltre 6 anni fa | 1

| accettato

Carica altro