Réponse apportée
index out of bounds
juju defines the intervals between sections. With 8 intervals, you define 7 sections. It fails when trying to get the 8th sectio...

environ 13 ans il y a | 0

Réponse apportée
Slow Triple for loop
1. Do the calculations as few times as possible: The following should be in the outer loop. - Unless you want latcounter to be a...

environ 13 ans il y a | 2

Réponse apportée
make a GUI for an existing programme
You can make a gui do almost anything, if you're willing to put in the effort to make it work the way you want it to. "guide" is...

environ 13 ans il y a | 0

Réponse apportée
initialising a color map
image_dat = uint16(randn(1024,1280)*5+5000); % random image (single colour channel) imagesc(image_dat) % display it colorbar ...

environ 13 ans il y a | 0

Réponse apportée
saving an variable into matlab for future use
Use cell arrays: variable{1} = 4; variable{2} = 'String'; variable{3} = 'D:\filehere\hi.wmv'; variable{4} = yourloadfu...

environ 13 ans il y a | 0

Réponse apportée
dynamic variable names in a loop
Thats a really bad idea. x={}; %real code loop starts here %pseudocode stuff = your input function that gets an input %...

environ 13 ans il y a | 0

Réponse apportée
if statement gives wrong results or does not work?
"any" and "all" are your friends, You have actually written if ALL of a >= a_sat set "b" else, if ALL of a < sat ...

environ 13 ans il y a | 0

| A accepté

Réponse apportée
Plotting multiple days on one graph
Plot the times as date numbers (check the documentation for "datenum") Change the x axis labels to the "datestr" with something...

environ 13 ans il y a | 0

Réponse apportée
finding values from matrix
A = [45 46; 42 43]; logical_address = A>45; A(logical_address) %gives you a single 46. linear_index = find(logical_addr...

environ 13 ans il y a | 0

Réponse apportée
How can I generalize this for loop?
Whats wrong with? t = cumsum(d)/total;

environ 13 ans il y a | 0

| A accepté

Réponse apportée
Generate variable names and assign them to workspace variables
This is the answer to the question you've asked: generated_variable_name = 'Big_whatever'; %(needs to be in your working wor...

environ 13 ans il y a | 1

| A accepté

Réponse apportée
How can I findout mean,standard deviation and variance using hiatogram of an image
Easier to do that straight from the image: my_image = uint16(randn(128,128)*16383); std_of_my_image = double(std(my_i...

environ 13 ans il y a | 0

Réponse apportée
How can I get 2 signal differences in log scale?
You can get the ratio between the power levels simply by taking dB1 - dB2. This is probably more sensible unless the numbers are...

environ 13 ans il y a | 0

Réponse apportée
Can I determine iteration number which matlab executes?
count = 0; while dx~=0 .... .... count = count + 1; end

environ 13 ans il y a | 1

| A accepté

Réponse apportée
Generating random numbers from normal distribution
If you take a random number from a gaussian (aka normal) curve, you can calculate the probability that number would come up. ...

environ 13 ans il y a | 0

| A accepté

Réponse apportée
how to maintain continuity and periodicity of a function
Try ensuring that your fit wraps around - ie, that you give it x = 366 and y = the value it has when x = 0.

environ 13 ans il y a | 0

Réponse apportée
Access elements/fields from a struct
Sounds like you have something like: b = dir('C:\Windows\'); b(1) names = fieldnames(b(1)); for i = 1:numel(nam...

environ 13 ans il y a | 4

| A accepté

Réponse apportée
Does in-equality operators work in comparison of two time format?
You have your brackets in the wrong places. (datenum(time_e_rad(j,:))< datenum(upp_lim)) && (datenum(time_e_rad(j,:)) >= d...

environ 13 ans il y a | 1

| A accepté

Réponse apportée
Why is GUIDE not allowing me to have one (1) column and three (3) rows in my table? It seems as if the default table is 4 x 2
In your workspace, generate the default contents for the table. Set the data on the table to that.

environ 13 ans il y a | 0

Réponse apportée
Indexing problem - how to obtain row and column and use later
whereAequalszero = A ==0; B = A; B(whereAequalszero) = 4;

environ 13 ans il y a | 0

| A accepté

Réponse apportée
how to plot y=ax+b for different equations
x = min_desired_x:step_size:max_desired_x; y = (x>0 & x<=1) * 1 + ... (x>1 & x<=3) * (2*x+1) + ... (x>3 & x<=5) *...

environ 13 ans il y a | 0

Réponse apportée
How to impute missing values using mean for a table
Use nansum, or nanmean, as required.

environ 13 ans il y a | 0

Réponse apportée
Hyper Image intensity level
You need to know the bit depth of each "slice" of your hypercube. (We can't tell you this, but its normally 8 bit for a standard...

environ 13 ans il y a | 0

| A accepté

Réponse apportée
Given an array of data, is it necessary to use FFT to get the amplitude?
Try plotting it and seeing what that tells you... (max(2nd column) - min(2nd column))/2 might make most sense ;)

environ 13 ans il y a | 0

| A accepté

Réponse apportée
Breaking up a matrix/array
codes = matrix(:,1); code_list = unique(codes); for i = 1:numel(code_list) new{i} = matrix(code_list(i) == codes,:); e...

environ 13 ans il y a | 0

| A accepté

Réponse apportée
subtract numbers in the row
diff(x)

environ 13 ans il y a | 1

| A accepté

Réponse apportée
change variable and assign to dataset in each loop
Three approaches for i = 1:12 %(Sheets not the same size) [numbers{i} texts{i} raws{i}] = xlsread(....); end Or ...

environ 13 ans il y a | 1

| A accepté

Réponse apportée
How to check the value of a varriable of a subfunction?
You can use the command line option dbstop if error Or you can insert breakpoints inside your function to inspect (or c...

environ 13 ans il y a | 0

Réponse apportée
Preallocating memory for a matrix of unknown size
At what point do you know the required size? If it's "at the end", then you do have to do with the "arbitrarily big" option, ...

environ 13 ans il y a | 4

| A accepté

Réponse apportée
Create a blank m-file by command lines
fid = fopen('D:\myfileshere\newfile.m','w'); fclose(fid); That will in fact create a new "m" file.

environ 13 ans il y a | 0

| A accepté

Charger plus