Réponse apportée
extract structure array value
You can hide the loop with arrayfun, but be aware that a good loop is always better than cellfun or arrayfun. You should ask you...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Error at 13.2
You edited the code of the Further Practice section, instead of the Task 1 & 2 section.

plus de 5 ans il y a | 0

Réponse apportée
calling class into another class
Here is an example from the documentation: classdef PositiveDouble < double methods function obj = PositiveDouble(da...

plus de 5 ans il y a | 0

Réponse apportée
How do I add a black border around an image?
You can pad an array with zeros. IM=uint8(255*rand(100,100)); IM2=zeros(120,120,'like',IM); IM2(11:110,11:110)=IM; imshow(IM...

plus de 5 ans il y a | 1

Réponse apportée
How to export the data corresponding to the new pixel size?
doc imresize

plus de 5 ans il y a | 0

Réponse apportée
Sub-matrix Access in a Square Pattern
It looks like either blockproc or mat2cell is what you're looking for.

plus de 5 ans il y a | 2

Réponse apportée
Write a function called valid_date that takes three positive integer scalar inputs year, month, day. If these three represent a valid date, return a logical true, otherwise false. The name of the output argument is valid.
You test everything at once. You can do that, but you need to pay attention to what is evaluated first: %steps in evaluation: ...

plus de 5 ans il y a | 0

Réponse apportée
Merging Smaller Cells into a Bigger one
The source of your problem is that you are using the same indices for your big array as for your smaller array. The solution to...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Split Climate Data for month and yers
d=19300101; s=sprintf('%08d',d); y=str2double(s(1:4)); m=str2double(s(5:6)); d=str2double(s(7:8)); Or even simpler: d=1930...

plus de 5 ans il y a | 0

Réponse apportée
While Loop regarding user input type stuck on infinite else loop
The data type of R is not changing, so if you create it as a char, it will never be numeric. If you want to use this setup, you ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
adding functions to path
Start with the documentation. It is one of the major advantages of Matlab over competing platforms. Do you understand what these...

plus de 5 ans il y a | 0

Réponse apportée
How to use 2 matrixes as the xlabel to a plot?
doc datetime

plus de 5 ans il y a | 0

Réponse apportée
How to plot a line graph (x,y) with a color bar representing z-axis...
You can use plot, colorbar, colormap, and caxis. You can adjust the line color by setting the Color property of the line object ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Load sequential numbered files in MatLab on the same script in different subfolders
Use mydata_folder{1} instead of mydata_folder1. That way you can use a simple loop instead of having to generate the variable na...

plus de 5 ans il y a | 0

Réponse apportée
Making An Output Display Twice What the Input Was
You need to make sure you receive the input as a numeric data type, or you need to convert the string input to a double (that is...

plus de 5 ans il y a | 0

Réponse apportée
X Bar doesn't show all labels
I don't really see why, but if you check get(gca,'XTick') you will notice that only the 1 and 2 have ticks in the first place. ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to selectively save the names and values of some workspace variables to a CSV file?
This should do the trick. If the variables aren't scalars the results might not be what you want. a = 3; b=7; c=5; d=9; sav...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
R2018b (MATLAB 9.5)
With external link, do you mean a pirated link? Because I don't think anyone will help you here. Do you have valid license? If ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Count characters per row
Trivial if you read your file to a cell array (e.g. with readfile, which you can get from the FEX or through the AddOn-manager (...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Remove line from text file if in the first column there is a certain character
Split the lines to cells and use a loop (or cellfun) to remove all elements where strcmp(contents(1),'$') is true. Then you can ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
simulate 500 different samplings with each sample containing 9 people from an array
doc randperm

plus de 5 ans il y a | 0

Réponse apportée
Why is latlon2local giving a error saying that it is undefined?
The latlon2local function was only introduced in R2020a, as the documentation clearly states. You will have to implement it your...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Suggestions for Input type from user
Your first problem can be avoided by using digit{1}(i) instead, since the numbers 1-9 don't change between values. Then you wil...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Problem with the code
You should check the rest of the file, because this is not the part of your code that will trigger that issue. There are some th...

plus de 5 ans il y a | 1

Réponse apportée
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-0.
This should do the trick: %your inital code: d = 1:10; dref = [3 5 7]; A = repmat(d, length(d),1); B = zeros(length(d),leng...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Sending ascii characters through system or dos command
If you don't find a real solution: you can write the command to a bat file and run that instead. You can use the > symbol to red...

plus de 5 ans il y a | 0

Réponse apportée
Find string in the special file
If notepad can open it and you see plain text, why do conclude it is not a text file? Even if there are some special characters ...

plus de 5 ans il y a | 0

Réponse apportée
How can I add a text with the statistical test name I conducted in a boxplot?
You probably need something like annotation. You could also use a more basic text object.

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Is it possible to put a compiled standalone executable on a datastick?
You have several options (feel free to add options if you have editing privileges, otherwise post a comment): Compile to a stan...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
MATLAB code to find the frequency of each element in some alloys
You can you the histogram related function histcounts to count occurences. You just need to split the alloy name in the constitu...

plus de 5 ans il y a | 0

| A accepté

Charger plus