Respondida
Problems trying to use bar
You can use the function below to create fake bars by using plot. This function accepts (nearly) all input arguments that plot a...

alrededor de 6 años hace | 0

| aceptada

Respondida
how do I create a function
You can use something like this: close all x1=rand(10,1); myfun(x1) x2=rand(10,1); myfun(x2) x3=rand(10,1); myfun(x3) x4...

alrededor de 6 años hace | 0

Respondida
Import data from text file and delete blank rows, columns, headers and unnecessary values
T=readmatrix('data.txt','NumHeaderLines',4); T(:,1)=[];%remove row indices in first column

alrededor de 6 años hace | 0

Respondida
How can I repeat this shape NxN times with a certain spacing between repeated shapes?
Make the coordinates depend on x1 and y1: x1=0.25; y1=0.25; draw_line_and_patch(x1,y1) function draw_line_and_patch(x1,y1,...

alrededor de 6 años hace | 0

Respondida
Is it possible to access the lines of code from a pre built command
You mean a builtin Matlab function? That may be possible, but since it is bound by copyright you can't actually use that knowle...

alrededor de 6 años hace | 0

| aceptada

Respondida
Treatment G-code file
str = fileread('gcode.txt'); cell_str=strsplit(str,'\n') character = 'Z'; TF = contains(cell_str,character); line_num=find(T...

alrededor de 6 años hace | 1

| aceptada

Respondida
can you help me to find out whats wrong here??
If you want to do this, you will probably have to convert to a char array and then convert to a double array. %because this is ...

alrededor de 6 años hace | 0

Respondida
Applying smoothing to image
A convolution may be what you need. mask=rand(3,3);mask=mask/sum(mask(:)); IM=uint8(randi(255,100,100)); IM2=convn(IM,mask,...

alrededor de 6 años hace | 0

Respondida
How to compute centered moving average from an NxM array
You can use a convolution with a flat array as the second input. avg_val = convn(M(:,2), ones(30,1)/30, 'valid');

alrededor de 6 años hace | 0

Respondida
slicing matrix in efficient way
Something like this should do the trick: a=1:120; b=reshape(a,10,3,[]); x=squeeze(b(:,1,:)); y=squeeze(b(:,2,:)); z=squee...

alrededor de 6 años hace | 0

| aceptada

Respondida
How to store values from push button and then add all values and display in a static text box
If you're using GUIDE for the first time: don't. Do not teach yourself a tool that will be removed from Matlab in one of the nex...

alrededor de 6 años hace | 0

| aceptada

Respondida
Adding a global legend to a tiledlayout
I can't get the position quite right, maybe you have more luck with your tinkering. This at least gets rid of the line. (I guess...

alrededor de 6 años hace | 1

| aceptada

Respondida
Replace values in matrix based on array values
Nobody is born knowing about ismember and ismembertol. (use the latter if you expect float rounding errors)

alrededor de 6 años hace | 0

Respondida
Matrix multiplication, matrix with variables
If this code works, why not use this? Fin=T_vit*R_lens_post*T_lens*R_lens_ant*T_aqueous*R_cor_post*T_cornea*R_cor_ant; You als...

alrededor de 6 años hace | 0

| aceptada

Respondida
Creating text for subcaptions in subplot figure
Even for subplots you can use the title and xlabel functions. Your picture looks like you want to use xlabel. clc;clear; rng(4...

alrededor de 6 años hace | 0

Respondida
Create matrix of maximum values from cell array
cellfun(@max,FR)

alrededor de 6 años hace | 0

| aceptada

Respondida
[DISCONTINUED] MATLAB Answers Wish-list #5 (and bug reports)
A soft-lock for questions, similar to StackExchange. This soft-lock would prevent low/no-reputation users (e.g. <5) from postin...

alrededor de 6 años hace | 1

Respondida
How to Concetanate Arrays in a Struct?
You were close with your commented code. %see what this returns? MasterResult.Durchschnittswert %you can concatenate that c...

alrededor de 6 años hace | 2

| aceptada

Respondida
How do I vectorize this for loop?
You will need to convert to linear indices with sub2ind.

alrededor de 6 años hace | 0

Respondida
replacing element which are <= previous element with NaN
This code may not be efficient for very large vectors. x = [1 2 3 4 3 2 3 4 6 8 5 5 6 8.5 9 11 12 ]; y=movmax(x,[numel(x)...

alrededor de 6 años hace | 0

| aceptada

Respondida
Change language to english
Your strong language is not necessary and makes people take you much less serious. There is no need for it. To change the langu...

alrededor de 6 años hace | 1

Respondida
is NVIDIA RTX 6000 , compatible with Matla R2020a and R2017b?
According to this documentation page: yes. The Quadro RTX 6000 is from the Turing architecture, so it is fully supported on R202...

alrededor de 6 años hace | 0

Respondida
how to save/write images using for loop in one .mat file
As Ameer suggests: you should share the code, so we can suggest how you can implement indexing. The point is that your code cur...

alrededor de 6 años hace | 0

Respondida
I am having trouble finding the curve fit of an equation in matlab
You're almost there: ln(y) = ln(A) + ln(x) + B*x ln(y) - ln(x) = ln(A) + B*x %so: y2 = ln(y) - ln(x); p = polyfit(x,y2,1)...

alrededor de 6 años hace | 0

| aceptada

Respondida
How to create a menu using GUI
You can use the uicontrol style text to create a block of text. Then make a callback function for a key press. In that callback ...

alrededor de 6 años hace | 0

| aceptada

Respondida
How can I find the centroid of this circle of objects?
There are at least two options here. The first is to take the average of the x coordinates and y coordinates of the white pixels...

alrededor de 6 años hace | 0

Respondida
for loop not working
Then you are stuck with first undoing that mistake. You should convert those coordinate variables to a single array. You can use...

alrededor de 6 años hace | 0

Respondida
how to recived input user in matlab
You need to specify that you want the result as a char array: str=input('enter the string>>','s'); It is also a good idea to d...

alrededor de 6 años hace | 1

| aceptada

Respondida
How to skip lines to execute/run?
You should be using strcmp to compare strings or chars, but otherwise what you describe is exactly what you need to do (well, on...

alrededor de 6 años hace | 0

Respondida
Changing decimals shown in matrix?
You can control this with the fomat function. The closest you can get is two decimals with format bank You should be aware tha...

alrededor de 6 años hace | 0

Cargar más